Any suggestions would be helpful
Thanks Al
It looks like there are syntax errors in the DLookup
criteria. If GLN is a value to match, then it need to be in
quotes:
. . . & DLookup("[ea degree] ", "[Warren Lodge
Membership]", "[GL ID] = 'GLN' ") & . . .
--
Marsh
MVP [MS Access]
"Marshall Barton" <marsh...@wowway.com> wrote in message
news:nrj8v5lrvtf0414sr...@4ax.com...
If you're looking for the row where [GL ID] equals the (numeric) value
stored in a variable named GLN, you need
DLookup("[ea degree] ", "[Warren Lodge Membership]", "[GL ID] =" & GLN)
If you're looking for the row where [GL ID] equals the (string) constant
GLN, you need
DLookup("[ea degree] ", "[Warren Lodge Membership]", "[GL ID] = 'GLN'")
--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)
"Als Hotmail" <alta...@hotmail.com> wrote in message
news:u8YGcg59...@TK2MSFTNGP02.phx.gbl...
I have never seen or heard of a problem with vbCrLf in a VBA
procedure. I can only guess that your post has other
inconsistencies that manifest the problem or you have
somehow set a variable named vbCrLf to something other than
the usual value.
--
Marsh
MVP [MS Access]
Als Hotmail wrote:
>The DLOOKUP function works. All of the information is printed without a line
>feed. the information is on one line.
>
>Any other suggestions?
>
>"Marshall Barton" wrote
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> wrote in message
news:#HLADp79...@TK2MSFTNGP02.phx.gbl...
Thanks Again
Al
"Marshall Barton" <marsh...@wowway.com> wrote in message
news:3p69v51mpte0hktc1...@4ax.com...
Als Hotmail wrote:
>I am having a lot of strange things happening in this computer. I am using
>Window 7 & Office Access 2007.
>After some automatic backups some programs disappear, I think when I first
>loaded the programs everything worked but after the updates the problems
>began. Number Lock keeps unlocking, Trim function gives complier error.
>I am about to restore to a earlier time.
>Do you have any suggestions?
>
>
>"Marshall Barton" wrote
>> If the DLookup works in your code, then we are wasting a lot
>> of time debugging the typos you introduced ny retyping
>> whatever you really have.
>>
>> I have never seen or heard of a problem with vbCrLf in a VBA
>> procedure. I can only guess that your post has other
>> inconsistencies that manifest the problem or you have
>> somehow set a variable named vbCrLf to something other than
>> the usual value.
>>
>>
Als Hotmail wrote:
>GLN should be [GLN] it is the same value as [GL ID]
>Thanks for your response Al
>
>"Douglas J. Steele" wrote.
>> I'm shocked that your DLookup works, as it's syntactically incorrect.
>>
>> If you're looking for the row where [GL ID] equals the (numeric) value
>> stored in a variable named GLN, you need
>>
>> DLookup("[ea degree] ", "[Warren Lodge Membership]", "[GL ID] =" & GLN)
>>
>> If you're looking for the row where [GL ID] equals the (string) constant
>> GLN, you need
>>
>> DLookup("[ea degree] ", "[Warren Lodge Membership]", "[GL ID] = 'GLN'")
>>
>>
>> "Als Hotmail" wrote
>>> The DLOOKUP function works. All of the information is printed without a
>>> line feed. the information is on one line.
>>>
>>> "Marshall Barton" wrote
This is in a report? And firstline is either the name of a text box on the
report, or is a variable whose value will be assigned to such a text box?
If so, check to make sure the text box's Can Grow property is set to Yes,
and that the Can Grow property of the report section containing the text box
is also set to Yes.
--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html
(please reply to the newsgroup)
All help is welcome
Thanks Al
"Marshall Barton" <marsh...@wowway.com> wrote in message
news:2qgav5hq96thvpbag...@4ax.com...
I guess we're back where we started.
The only reasons I can think of that would cause vbCrLf to
fail to do its thing:
1) somewhere in your VBA project you declared vbCrLf as a
variable or constant.
2) the text box has a property (RichText, Html, ??) set
that ignores vbCrLf
3) the form is corrupted.
OR use
VBA.vbCrLf
in place of the simple vbCrLf and see if that works.
If those work, then I agree with Marshall's evaluation as to the causes of the
problem.
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
6918 Yale Rd Middle River, MD 21220
The space between records is 2 records.
The OS is Win7 & Access 2007. Both were reloaded because various problems
that has been corrected.
Thanks Al
"John Spencer" <spe...@chpdm.edu> wrote in message
news:#4TGe5z#KHA....@TK2MSFTNGP04.phx.gbl...
[GL ID] is on the form that is based on qryFormACodeData.
[GLN] is in a Membership Table.
IS [GL ID} a field in the table [Warren Lodge Membership]?
Is [GLN] a field in that same table?
For the DLookup to work as it should both those fields would have to be in the
table Warren Lodge Membership. If they aren't both in that table then your
code should not be executing for that case since in all probability the
DLookup is going to return NULL if it doesn't error.
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
"John Spencer" <spe...@chpdm.edu> wrote in message
news:eyjel12#KHA....@TK2MSFTNGP05.phx.gbl...
I don't understand why, but it worked.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"Al Hotmail" <alta...@hotmail.com> wrote in message
news:AD31DDD8-4301-4A4E...@microsoft.com...
DLookup("[SendMail]", "[Warren Lodge Membership]", "GLN =" & [GL ID]) = -1
Or this if GLN was a Text field
DLookup("[SendMail]","[Warren Lodge Membership]","GLN ='" & [GL ID] & "'")= -1
Also, you could simplify life and speed up the process with only one call to
DLookup to return the value for FirstLine with something like the following.
DLookup("[Address] & Chr(13) & Chr(10) & [City] & "", "" & [State] & "" "" &
[Postal Code]","[Warren Lodge Membership]","GLN ='" & [GL ID] & "'")
I really think that something else is going on and that your case statement
and DLookup are not working as you think. I've not seen the behavior you are
seeing.
> Obviously there is something we are not seeing. From what you say
> and my understanding of how things work your code should NOT work.
> I would expect to see the following if GLN is a number field
>
> DLookup("[SendMail]", "[Warren Lodge Membership]", "GLN =" & [GL
> ID]) = -1
>
> Or this if GLN was a Text field
> DLookup("[SendMail]","[Warren Lodge Membership]","GLN ='" & [GL
> ID] & "'")= -1
>
John, the = -1 is redundant, and your closing parenthesis is
misplaced.
Bob
The expression was extracted from the bit of code that was an IF statement
IF DLookup("[SendMail]","[Warren Lodge Membership]","GLN=" & [GL ID])=-1 THEN
I was not clear on where I was extracting the expression from. I relied on
the poster to realize that. I also assumed that SendMail was a boolean field.
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County