Problem with Dlookup function *12162008

J

J.Alladien

Hi guys,

I have a form"AANVRAAG_JETZZA2"(with underlaying table for values) with a
certain field (only numbers) named "POP" ,on this form I would like to
display in another field the values from another table of mine(TYPES) ;So
this is what I did:


=DLookUp("TYPE","TYPES","TYPE-ID=forms![AANVRAAG_JETZZA2]![POP]")

When I do this I get # error#

What Am I doing wrong!
Thanks in advance for the help!
 
J

John W. Vinson

Hi guys,

I have a form"AANVRAAG_JETZZA2"(with underlaying table for values) with a
certain field (only numbers) named "POP" ,on this form I would like to
display in another field the values from another table of mine(TYPES) ;So
this is what I did:


=DLookUp("TYPE","TYPES","TYPE-ID=forms![AANVRAAG_JETZZA2]![POP]")

When I do this I get # error#

What Am I doing wrong!
Thanks in advance for the help!

If the Data Type of TYPE-ID is in fact Text (even if its values are only
numeric digits) you need the syntactically required quotemarks. Since your
fieldname (unwisely, IMO) contains a special character - the hyphen - you
should also enclose it in square brackets. Try

=DLookUp("TYPE","TYPES","[TYPE-ID]= '" & [forms]![AANVRAAG_JETZZA2]![POP] &
"'")
 
J

J.Alladien

Hi John,

That did it thanks a lot

John W. Vinson said:
Hi guys,

I have a form"AANVRAAG_JETZZA2"(with underlaying table for values) with a
certain field (only numbers) named "POP" ,on this form I would like to
display in another field the values from another table of mine(TYPES) ;So
this is what I did:


=DLookUp("TYPE","TYPES","TYPE-ID=forms![AANVRAAG_JETZZA2]![POP]")

When I do this I get # error#

What Am I doing wrong!
Thanks in advance for the help!

If the Data Type of TYPE-ID is in fact Text (even if its values are only
numeric digits) you need the syntactically required quotemarks. Since your
fieldname (unwisely, IMO) contains a special character - the hyphen - you
should also enclose it in square brackets. Try

=DLookUp("TYPE","TYPES","[TYPE-ID]= '" & [forms]![AANVRAAG_JETZZA2]![POP] &
"'")
 

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

Problem with my Dlookup 5
DLookup debacle 4
Dlookup and Conditional Formatting 3
DLOOKUP 2
Access 2007 DLOOKUP 26
DLOOKUP Save to Table 2
dlookup 2
pop up form to open one record with dlookup 1

Top