Log in

View Full Version : Dlookup keeps returning "You cancelled the previous operation"



mud2
12-12-2006, 01:30 PM
Try as I might, I keep getting the same error(?) message.
Following ACCESS'S "Help" for Dlookup()...
Dlookup("[Field1]","Table1","[Field1] = Table1_3")
Field1 is the name of a field in Table1, and Table1_3 is a value in Field1 in Table1.
???

OBP
12-13-2006, 04:13 AM
mud2, it sounds like it is not finding anything to match.
Any chance of posting or emailing it?
I have used dlookup in the past, this is an example of the first one

DLookUp("[PTMArea]","IMRR PTM Area Control","CurrentUser()=[IMRR PTM Area Control]![Users]"

Notice that the lookup has to use something "Current", i.e. a value in the current query or the value from a currently open Form.

mud2
12-13-2006, 09:14 PM
I want to use dlookup, with its arguments passed in by some calling sub. Reason, because I'll use dlookup several times, with differing domaines and conditions. If I 'Hard wire" the arguments in, dlookup works. If I construct arguments that look like the hard wired arguments...dlookup does not work!

OBP
12-14-2006, 08:04 AM
mud, I use the module to write the data to a table and then use the Dlookup to get the data from the table.

mud2
12-15-2006, 09:28 PM
Check my entry under "...how to extract..."