can dlookup be used on a text field

J

Jamie

I had a dlookup expression on a form based on a number field called [Proj #].
I changed [Proj #] to be a text field and now the dlookup expression returns
#Name# as the result. Any ideas?
 
O

Ofer

Try this, adding a single quote before and after the criteria
=DLookUp("[Project Name]","[Table Name]","[Proj #] = '" & [Proj #] & "'")
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Jamie said:
The dlookup is supposed to return the [Project Name] in the expression field.

Jamie said:
I had a dlookup expression on a form based on a number field called [Proj #].
I changed [Proj #] to be a text field and now the dlookup expression returns
#Name# as the result. Any ideas?
 
J

Jamie

It already does have the single quotes... what looks wrong with it?

=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = " & [Forms]![Status
Update Weekly]![Proj #])

Ofer said:
Try this, adding a single quote before and after the criteria
=DLookUp("[Project Name]","[Table Name]","[Proj #] = '" & [Proj #] & "'")
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Jamie said:
The dlookup is supposed to return the [Project Name] in the expression field.

Jamie said:
I had a dlookup expression on a form based on a number field called [Proj #].
I changed [Proj #] to be a text field and now the dlookup expression returns
#Name# as the result. Any ideas?
 
R

Rick Brandt

Jamie said:
It already does have the single quotes... what looks wrong with it?

Look at his expression then look at yours. His has single quotes in
addition to the double quotes that you have.
=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = " &
[Forms]![Status Update Weekly]![Proj #])

Ofer said:
Try this, adding a single quote before and after the criteria
=DLookUp("[Project Name]","[Table Name]","[Proj #] = '" & [Proj #] &
"'") --
 
O

Ofer

But you don't have a single quote in the dlookup you gave us
That yours
=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = " & [Forms]![Status
Update Weekly]![Proj #])
If the Proj # is string, then change it to
=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = '" & [Forms]![Status
Update Weekly]![Proj #] & "'")
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Jamie said:
It already does have the single quotes... what looks wrong with it?

=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = " & [Forms]![Status
Update Weekly]![Proj #])

Ofer said:
Try this, adding a single quote before and after the criteria
=DLookUp("[Project Name]","[Table Name]","[Proj #] = '" & [Proj #] & "'")
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Jamie said:
The dlookup is supposed to return the [Project Name] in the expression field.

:

I had a dlookup expression on a form based on a number field called [Proj #].
I changed [Proj #] to be a text field and now the dlookup expression returns
#Name# as the result. Any ideas?
 
D

Douglas J. Steele

I don't see single quotes in your statement.

=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = '" &
[Forms]![Status Update Weekly]![Proj #] & "'")

Exagerated for clarity, that's

=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = ' " &
[Forms]![Status Update Weekly]![Proj #] & " ' ")



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jamie said:
It already does have the single quotes... what looks wrong with it?

=DLookUp("[Project Name]","[PROJECT MASTER]","[Proj #] = " &
[Forms]![Status
Update Weekly]![Proj #])

Ofer said:
Try this, adding a single quote before and after the criteria
=DLookUp("[Project Name]","[Table Name]","[Proj #] = '" & [Proj #] & "'")
--
If I answered your question, please mark it as an answer. That way, it
will
stay saved for a longer time, so other can benifit from it.

Good luck



Jamie said:
The dlookup is supposed to return the [Project Name] in the expression
field.

:

I had a dlookup expression on a form based on a number field called
[Proj #].
I changed [Proj #] to be a text field and now the dlookup expression
returns
#Name# as the result. Any ideas?
 
Top