DLookup

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

Guest

L.S.

I'm attempting to import data from table B into table A through a form based
on table A. The data to be imported from table A should correspond to what is
being inputted into the form in a field which has an options relationship
with table B.

I've tried to use the expression I found in the helpfiles, but I keep
getting the message that the syntax is incorrect, I've also tried to do small
modifications, like removing space or changing the comma into a semicolon,
but nothing helps. What I found in the help files;

=DLookUp("[Productnaam]", "Producten", "[Product-id] =" _
& Forms![Orderinformatie]!Product-id)

And a variation;

=DLookUp("[LastName]", "Employees", _
"[EmployeeID] = Forms![Orders]![EmployeeID]")

Somebody who could help me out? Or can I use something else to achieve the
result I require?

Kind regards,

VVCM
 
Your first example is correct if [Product-id] is a numeric field and the name
of your form is Orderinformatie and Product-id is a control on that form. If
it is a text field, it should be in quotes:
=DLookUp("[Productnaam]", "Producten", "[Product-id] = '" _ &
Forms![Orderinformatie]!Product-id & "'")

That will not create a syntax error; however. I think you may be using it
in an incorrect place. Post back with where you have this code.
 
Back
Top