Dlookup help!!

K

KAnoe

I have a form that I would like the Dlookup to do the following

The table has a Company code called RSID. I would like the Dlookup to look up the name of the company in the Company table

FM Name is Order form. Feild in Form is RSID.
Table to look in is Company_Data to match the RSID to the Company Name

I have a book that has me doing it like this
Dlookup("Company Name]","[Company_Data]","[RSID]
=Form![Order form]![RSID]"

any help would be great!
 
A

Allen Browne

Try:
=Dlookup("Company Name]", "[Company_Data]",
"[RSID]" = Form![Order form]![RSID])

If RSID is a Text field (not a Number field), you need extra quotes:
=Dlookup("Company Name]", "[Company_Data]",
"[RSID]""" = Form![Order form]![RSID] & """")

For an explanation, see:
http://allenbrowne.com/casu-07.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

KAnoe said:
I have a form that I would like the Dlookup to do the following.

The table has a Company code called RSID. I would like the Dlookup to look
up the name of the company in the Company table.
FM Name is Order form. Feild in Form is RSID.
Table to look in is Company_Data to match the RSID to the Company Name.

I have a book that has me doing it like this.
Dlookup("Company Name]","[Company_Data]","[RSID]"
=Form![Order form]![RSID]")
 

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


Top