DLookup Problems in Access Form

mccloy1285

New Member
Joined
Sep 1, 2015
Messages
6
Hi,

I have a form which has shift information on it. Name, Date, Machine etc.

I have created a small table for machine targets which looks like this:

Machine, Throughput, OE, JE, OEE
Control 1 77% 70% 96% 51.2%
Control 4 60% 70% 91% 48.8%

I have then created a query of this table, called "qSelMachineTargets" so that this data can be found easily.

In a text box in my form I have the equation:

=DLookUp("Throughput","qSelMachineTargets","Machine=" & [txtMachine])

so that depending what machine is shown in the form, either Control 1 or Control 4, it can lookup and find the respective throughput target. My problem is that I only get #Error when I view the form.

Can anyone help please?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try using single quotes around the last argument:
=DLookUp("Throughput","qSelMachineTargets","Machine='" & [txtMachine] & "'")

Text literals must have quotes. You have to put this in when you create the string expresssion.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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