DLookup Not Working

G

Guest

I've read most of the Dlookup questions on this subject but cannot seem to
use this knowledge to get mine to work. I am trying to get my form's text
box to pull up the field [FullName] from [qryClient_Narrow] based upon the
form's text box [Hospital No].

=DLookUp("FullName","[qryClient_Narrow]","[qryClient_Narrow]![Hospital
No]='" & [Hospital No])
 
G

Guest

It appears to be a syntax issue.
=DLookUp("FullName","[qryClient_Narrow]","[qryClient_Narrow]![Hospital
No]='" & [Hospital No])

As written, it is incorrect for both.
If Hospital No is a text field, it should be:
=DLookUp("FullName","[qryClient_Narrow]","[Hospital No]='" & [Hospital No])
& "'"

If Hospital No is a numeric field,it should be:
=DLookUp("FullName","[qryClient_Narrow]","[Hospital No]= " & [Hospital No])
 
G

Guest

Dave,
Thanks for your assistance. It now works perfectly.

Klatuu said:
It appears to be a syntax issue.
=DLookUp("FullName","[qryClient_Narrow]","[qryClient_Narrow]![Hospital
No]='" & [Hospital No])

As written, it is incorrect for both.
If Hospital No is a text field, it should be:
=DLookUp("FullName","[qryClient_Narrow]","[Hospital No]='" & [Hospital No])
& "'"

If Hospital No is a numeric field,it should be:
=DLookUp("FullName","[qryClient_Narrow]","[Hospital No]= " & [Hospital No])

--
Dave Hargis, Microsoft Access MVP


Brian J said:
I've read most of the Dlookup questions on this subject but cannot seem to
use this knowledge to get mine to work. I am trying to get my form's text
box to pull up the field [FullName] from [qryClient_Narrow] based upon the
form's text box [Hospital No].

=DLookUp("FullName","[qryClient_Narrow]","[qryClient_Narrow]![Hospital
No]='" & [Hospital No])
 

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

Top