Problem with DLookup function

J

John S. Ford, MD

What's the matter with this line of code:

varX = Not (DLookup("[PatientMRNumber]", "qryDATA_Patients",
"[PatientMRNumber]=" & txtMRNumber))

[PatientMRNumber] is a text field. varX is type Variant. txtMRNumber is a
TextBox control for which people type a number.

The code triggers the following error: "Data type mismatch in criteria
expression." If I substitute CStr(txtMRNumber) for txtMRNumber, I still get
the same error.

Any ideas as to what I'm doing wrong?

John
 

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


Top