can dlookup be used on a text field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
The dlookup is supposed to return the [Project Name] in the expression field.
 
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?
 
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?
 
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 #] &
"'") --
 
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?
 
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?
 

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

DLookup and Nz 0
DLookUp 1
Dlookup 7
Bound a DLookUp Value 2
How to update a table field from a calculated form text box 2
DLookup in Text box to show Currency (number field) 9
DLOOKUP 2
Dlookup error 4

Back
Top