DLookup???

  • Thread starter Thread starter Ray Yeung
  • Start date Start date
R

Ray Yeung

Dear All,

Can anyone help me!!

I would like to lookup two values in a row at table by using DLookup
function to get "RecordID" as below.

me.text17 = 100002
strReturndate = 1000/1/1

a = DLookup("[RecordID]", "Record", "[MagazineID] = '" & Me.Text17 & "' and
[Returndate] =" & strReturndate)

that come up with Run-Time Error '3464'.

Thank you very much,
Ray
 
Dear Douglas J. Steele,

Thank you for your help.

Ray
Douglas J. Steele said:
Dates need to be delimited with # characters.

a = DLookup("[RecordID]", "Record", "[MagazineID] = '" & Me.Text17 & "' and
[Returndate] = #" & strReturndate & "#")

(In general, the date should be in mm/dd/yyyy format, but yyyy/mm/dd will
work as well)

And, if MagazineID is a numeric field, get rid of the single quotes you're
putting on either side: you only need those for text fields.

Note that I'm assuming Returndate is a Date/time field. If it's a text
field, then use single quotes where I put # above.

--
Doug Steele, Microsoft Access MVP



Ray Yeung said:
Dear All,

Can anyone help me!!

I would like to lookup two values in a row at table by using DLookup
function to get "RecordID" as below.

me.text17 = 100002
strReturndate = 1000/1/1

a = DLookup("[RecordID]", "Record", "[MagazineID] = '" & Me.Text17 & "' and
[Returndate] =" & strReturndate)

that come up with Run-Time Error '3464'.

Thank you very much,
Ray
 
Back
Top