DLookup Problem

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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] & """")
 
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] & """")
 
Back
Top