DLookup Problem

G

Guest

I work for a Hotel corporate office. I am trying to create a database to
store and track any customer complaints and the resolution. Everything is
going good, so far, except for one problem.
I am trying to do a DLookup, taking the property name from the Complaint
table, which stores the specific complaint information, and looking up the
Operational Vice President in the Hotels table.
Lets say that the Property field in the Complaint table has Hotel1 stored.
And the field containing Hotel1 in the Hotel table is named Property Name.
The DLookup command that I was trying to run was DLookUp("[Operational Vice
President]","[Hotels]","[Property Name] =" & [Property])

Whenever I run the query, all I get is #Error

Any thoughts on what may be causing this?
 
B

Brian

Steve Voorhees said:
I work for a Hotel corporate office. I am trying to create a database to
store and track any customer complaints and the resolution. Everything is
going good, so far, except for one problem.
I am trying to do a DLookup, taking the property name from the Complaint
table, which stores the specific complaint information, and looking up the
Operational Vice President in the Hotels table.
Lets say that the Property field in the Complaint table has Hotel1 stored.
And the field containing Hotel1 in the Hotel table is named Property Name.
The DLookup command that I was trying to run was DLookUp("[Operational Vice
President]","[Hotels]","[Property Name] =" & [Property])

Whenever I run the query, all I get is #Error

Any thoughts on what may be causing this?

On the assumption that [Property Name] is text, try this:

DLookUp("[Operational Vice President]","[Hotels]","[Property Name] =""" &
[Property] & """")
 
G

Guest

That took care of it. Thank you.
I very rarely ever need to asked for any help. But its great to know that
there is help when needed. Thanks again.

Brian said:
Steve Voorhees said:
I work for a Hotel corporate office. I am trying to create a database to
store and track any customer complaints and the resolution. Everything is
going good, so far, except for one problem.
I am trying to do a DLookup, taking the property name from the Complaint
table, which stores the specific complaint information, and looking up the
Operational Vice President in the Hotels table.
Lets say that the Property field in the Complaint table has Hotel1 stored.
And the field containing Hotel1 in the Hotel table is named Property Name.
The DLookup command that I was trying to run was DLookUp("[Operational Vice
President]","[Hotels]","[Property Name] =" & [Property])

Whenever I run the query, all I get is #Error

Any thoughts on what may be causing this?

On the assumption that [Property Name] is text, try this:

DLookUp("[Operational Vice President]","[Hotels]","[Property Name] =""" &
[Property] & """")
 

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

Dlookup Expression Error 2
DLookup Problem 10
Dlookup in Query 2
dlookup problems 3
DLookup Problem 2
Dlookup problem with date.. 1
Access ACCESS DLOOKUP INVALID USE OF NULL 0
Dlookup in query 1

Top