Dlookup Problem

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
Not getting a result

On a form I want to look for a value in a separate table based on a value in a Text box on this form

My table Name is: tblRFPStageLst
I want the Value from: Catagory1
Looking for a Match to the Field: RFP_Stage

The Textbox on the Form is: RFP_StageX

Here is the last thing I tried: =DLookUp("Catagory1","tblRFPStageLst","RFP_Stage=RFP_StageX")

Thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
In your table, what data type is RFP_Stage?

If it is numeric, then your condition would look like:
Code:
[COLOR=#333333]"RFP_Stage=" & Me.RFP_StageX[/COLOR]

If test, then try:
Code:
[COLOR=#333333]"RFP_Stage='" & Me.RFP_StageX & "'"[/COLOR]
 
Upvote 0
Can you define numeric? The format is Short Text in the Table, but what's in there are numbers (1, 2 or 3)

Correction: RFP_Stage is Short Text (Text)
 
Last edited:
Upvote 0
Yep, the word "Text" is a dead giveaway.
An easy way to tell is if you are allowed to enter non-numeric values in it. If you are, it is not numeric.

All text entry values must be enclosed in quotes, as shown in my second example.
 
Upvote 0
This is what happens;

=DLookUp("Catagory1","tblRFPStageLst","RFP_Stage='" & [Me].[RFP_StageX] & "'")

Its changing this "RFP_Stage='" & Me.RFP_StageX & "'"
 
Upvote 0
That should be all right.
Does it work when you try it?
 
Upvote 0
The Textbox on the Form is: RFP_StageX
Is this a bound or unbound text box?

If unbound, when is it updated?

And is you calculation going into another unbound text box?
 
Upvote 0
I put this formula in an unbound text box in the Source Control

I triple checked all the spelling/names
 
Last edited:
Upvote 0
Sorry for maybe not being clear, but I was also inquiring about the "RFP_StageX" text box on your form in my previous post.
Is that a bound or unbound text box?
If unbound, how/when is that being populated?
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,309
Members
451,696
Latest member
Senthil Murugan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top