PDA

View Full Version : DLookUp for two fields


amna
05-28-2002, 04:36 PM
Hi,
Can some one help me with Dlookup function.
Actually I want to look up for two fields.
for example, in my table Log Record , I have two fields, WInumbers and names.
Now when ever user enter information from data entry form, like, name and workinstrustion number, then it should look up in the table to see, if that person already view that Work Instruction or not.
I am using this Dlookup function on my click event, but don t know what s wrong with that.



If (Dlookup( [WInumber] , [Log Record] , [Names] = & [Combo23] & )) Then

MsgBox You cannot view that slide , vbCritical,
Else
MsgBox yes you can have an access
End If


when I click on button for look up, then it gives me an error message, that out of stack space and type mismatch.
can some one help me with this.


Thanks in advance

tagger418
05-29-2002, 09:04 AM
You missed a bit in this line:

<BLOCKQUOTE id=quote><font size=1 face= Arial, Times New Roman, Times New Roman id=quote>quote:<hr height=1 noshade id=quote>
If (Dlookup( [WInumber] , [Log Record] , [Names] = & [Combo23] & )) Then
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face= Arial, Times New Roman, Times New Roman size=2 id=quote>

You should have something after the last ) and before the Then to compare the Dlookup to. Is it supposed to be equal to somehting, less then something, are you testing for Nulls?

If there is anything else I can do for you please let me know.

~Tagger