Dlookup question

H

Hans

Hi,

I am running Access XP.

I am trying to perform a dlookup, but get a null response.
When I try the code in the immediate window, i get the
following result:

? DLookup("[ID]", "Bookings", "[Resource] = '1'")
111111
? DLookup("[ID]", "Bookings", "[Resource] = Forms!
[Bookmain]![Resource1]")
Null

What am I missing or doing wrong....txs in advance....H
 
D

Dan Artuso

Hi,
With the hard coded example, you enclosed the value in quotes.
You have to do the same with the for the second one as well:

? DLookup("[ID]", "Bookings", " [Resource] ='" & Forms! [Bookmain]![Resource1] & "'")
 

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

Similar Threads

DLookup Help 4
Type Mismatch in dLookup 10
Problem with DLookup 3
DLookup or Code 2
DLookup Syntax Error 3
You Cancelled the previous Operation 2001 2
Dlookup syntax problems 5
DLookup Criteria 2

Top