Dlookup question

  • Thread starter Thread starter Hans
  • Start date Start date
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
 
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


Back
Top