DLookUp - Where's my Error???

txgeekgirl

Registered User.
Local time
Today, 03:57
Joined
Jul 31, 2008
Messages
187
I am trying to get this DLookUp to give me a date.

In the Audit Table, there is an Auto ID Field AuditID and of course the date fields for the beginning and ending Audit date ranges.

CheckAuditSDate is a Global Variable needs to be populated with the start date from the Audit tbl.

Me.AuditMeTB is a TB control on the Update Results Form.

I have tried with double and single quotes and without. I do get a vlue on mouse over of 38 (which is correct) for Me.AuditMeTB.:)

CheckAuditSDate = DLookup("[AuditRangeBDate]", "[Audit]", "[Audit]![AuditID]= '" & Me.AuditMeTB & "'")
MsgBox CheckAuditSDate
 
If auditME TB is a # that you are comparing to auditID then you need to do it like

"[Audit]![AuditID]= & Me.[AuditMeTB] & "
 
If auditME TB is a # that you are comparing to auditID then you need to do it like

"[Audit]![AuditID]= & Me.[AuditMeTB] & "

Ray - I think you meant:

"[Audit]![AuditID]= " & Me.[AuditMeTB]
 
Thank you guys - It worked and all is happy.

So - if I have it right, if both are values (numeric) then they don't need all that single quote double quote stuff, right? But if they are strings then I have to have all that.
 

Users who are viewing this thread

Back
Top Bottom