Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup problem

Status
Not open for further replies.

chrisaroundtown

Technical User
Joined
Jan 9, 2003
Messages
122
Location
AU
I need to do a DLookup from a form however I want to test 2 criteria and not just one, how do I do this with the below forumula.

=DLookUp("[Skl 2]","[Li Split Groups TBL]","[GroupName]=txtGroupName")

Hence, this is asking for the field [Skl 2] from the table [Li Split Groups TBL] when [GroupName] is equal to txtgroupName. I want to add a criteria to say only return [Skl 2] where [GroupName]=txtGroupName and [Date]=txtDate. how do I write that?

Thanks
Chris
 
Chris

Yes, you can combine your two fields - the last option in the DLookUp is your "WHERE" clause without the "Where".

=DLookUp("[Skl 2]","[Li Split Groups TBL]","[GroupName]= " & "'" & txtGroupName & "'" & " and [YourDate] = " & "#" & txtDate & "#")

Note:
[Date] is a reserved word - it is not recommended to use reservered words for field names.
It is recommended that you avoid using spaces in variable names.


Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top