DLookup???

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
 
R

Ray Yeung

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top