Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup Help

Status
Not open for further replies.

EdwardSalas

Technical User
Oct 20, 2004
8
US
Afternoon All,

I've been trying to get this DLookup to work on_update of one of my fields. However, each time the field updates, I get a "You cancelled the previous operation error". Any ideas? Here is the DLookup:

[Old_Shelf] = DLookup("[SHELVES]", "tblAttribute", "[Category]=" & Forms![frmMaster]![Category] & " AND [SIZE]=" & Forms![frmMaster]![Old_Section_Size])

Many thanks
 
Try
[Old_Shelf] = DLookup("[SHELVES]", "tblAttribute", "[Category]='" & Forms![frmMaster]![Category] & "' AND [SIZE]='" & Forms![frmMaster]![Old_Section_Size] & "'")

I think you are missing the ' around your values. I have hard time figuring this out myself and spent 20 minues today figuring out a Where clause for a sql statement.
 
Just to expand slightly on what Ascentient said, you need the single quotes around text values (presuming Category to be a text field) but not around the size reference if this is a numeric field..

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top