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] & "'")
 
Back
Top