Me!txtStad = DLookup("[Fieldname]". "tblPostnummers","[Id] = " & nBoxValue)
Note that when using a number for the criteria that there is no need for the
apostrophe before and after the variable. I've removed the .Value from your
syntax because .Text is the default property.
Warning! Don't use the word "Name" as a field name because it is a reserved
word in Access and it may cause problems down the track.
Stewart
"Ronny Sigo" <ro*********@erfgoednet.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I want to perform a DLookup function with a variable (long) as critera.
I know if it was a string this would be the correct syntax :
Me!txtStad.Value = DLookup("[Name]", "tblPostnummers", "[Id] = '" &
sBoxvalue & "'")
Can anybody give me the correct syntax when boxvalue is a number (long)
(In that case it would be called nBoxvalue.
I don't seem to understand the delimiting :(:(:(
Any help appreciated ....
Thanks
Ronny Sigo