Dlookup in table won't work

E

EMS

Looking for an explanation of why a dlookup function in a form is not
working. Here are the details:

Form name = "Main Form"
"Office Number" field is bound to the record source for the form
"Territory" field contains the dlookup function

Table name = "Offices"
Table fields used in dlookup are "Office No" and "Territory Name"

I need the "Territory" field in the form to lookup the "Office Number" field
in the "Offices" table and return the value for "Territory Name"

Here's is the dlookup function:

=DLookUp("[Territory Name]","[Offices]","[Office No]=" & [Forms]![Main
Form]![Office Number])

The error I get is #Error.

Any help is appreciated.
 
M

Mike Painter

EMS said:
Looking for an explanation of why a dlookup function in a form is not
working. Here are the details:

Form name = "Main Form"
"Office Number" field is bound to the record source for the form
"Territory" field contains the dlookup function

Table name = "Offices"
Table fields used in dlookup are "Office No" and "Territory Name"

I need the "Territory" field in the form to lookup the "Office
Number" field in the "Offices" table and return the value for
"Territory Name"

Here's is the dlookup function:

=DLookUp("[Territory Name]","[Offices]","[Office No]=" & [Forms]![Main
Form]![Office Number])

The error I get is #Error.

Any help is appreciated.
Relate the tables and use a query, there does not appear to be any need for
a look up.
 

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

Top