DLookup criteria syntax

Freshman

Registered User.
Local time
Today, 22:23
Joined
May 21, 2010
Messages
437
Hi all,

I need some help with the syntax in setting 2 criterias for a DLookup query.

I've attached a sample db with 2 tables: Main & Timesheet

I need a "combo" query showing (on the same line) all Qty for Transcodes N, 1 & 2 where the Staff number and TSNum is the same.

I'm sure about the logic but the syntax is letting me down.

I can pull in 1 of the criteria eg:

OT1: DLookUp("Qty","ExOT1","[Staff] =" & [Staff])

But can for the life of me not script the second criteria in.

So in my result of ExCombo I'm getting Staff 11 showing 4 under OT1 while I know the result does not apply for TSNum 29832 as indicated hence the need for the 2nd criteria.

Since I have to change some of the values to text inside the query it might be best to have a look at the attached db rather than just suggesting the correct syntax if you don't mind.

Thanks a lot
Pierre
 

Attachments

Ahh thanks Paul you beat me to answering my own question.Google led me to the same link.OT1: DLookUp("Qty","ExOT1","[Staff] =" & [Staff] & " AND [TSNum] =" & [TSNum])Did the trick.It is 3am here - might be the problem... :)
 
Happy to help and good night!
 

Users who are viewing this thread

Back
Top Bottom