ACCESS DLOOKUP trouble

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I am having trouble with this Dlookup

=DLookUp("[WBS_PG_ID]","qryPIDBOE","[PID_Number]=" & [Forms]![frmEstimates]![ComboBOESelectPID])

In the Query named qryPIDBOE I need to grab the WBS_PG_ID where the combobox named comboBOESelectePID on my form named frmEstimates equals the field in the query named PID_Number

Query Name: qryBIDBOE
Query fields: WBS_PG_ID & PID_Number

Form Named: frmEstimates
Combobox: ComboBOESelectPID
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
If the rowsource of the combo box is fields from "qryPIDBOE" then instead of using Dlookup (which should be used sparingly due to how inefficient they are). you should include extra columns in the combo box, set their width to 0 and then pull into another control using =ComboBOESelectPID.column(n) where n is the number of the column (starting at 0).

If not then I don't see anything wrong with your Dlookup provided PID_Number and ComboBOESelectPID are both numeric. if not then try:

Code:
=DLookUp("[WBS_PG_ID]","qryPIDBOE","[PID_Number]= '" & [ComboBOESelectPID]&"'")
 
Upvote 0
Thanks, based on your advice and others I am going to avoid a Dlookup
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,855
Members
451,674
Latest member
TJPsmt

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