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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,214,822
Messages
6,121,772
Members
449,049
Latest member
greyangel23

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