Dlookup help!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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