looking up table values based on two inputs

kicrewd

Registered User.
Local time
Yesterday, 15:25
Joined
Sep 3, 2014
Messages
18
I am creating a database to perform some engineering calculations based on user inputs and print various reports based on those calculations.

My main problem is that I have tables from the National Electrical Code (NEC) that I need to pull values from. So for instance, the user will put data for several motors in a table. Based on two of these inputs: Voltage and Horsepower, I need the database to look up the NEC table value of Current for each motor. I would like this to automatically be stored in the table or a query so that Current value can be used for further calculations.

In the end, the user will be able to select a report for an individual motor which will contain most of the input values along with this looked-up Current value and other calculated values.

In Excel, the task of looking up the current would be very easy. The NEC data would be in a spreadsheet with column headers for Voltage, row headers for Horsepower and cells storing a Current. You could look up a Current by indexing a single cell from a Voltage and Horsepower.

What is a good way to do this in Access?
 
hi kicrewd

Essentially the same, you use DLOOKUP(). the parameters of DLOOKUP() are;
Expression - what you want to lookup, the same as the column number you want to return with VLOOKUP()
Domain - the source of the data you want to look at (a table or query generally), the same as the table_array in VLOOKUP()
Criteria - the conditions that identify the correct record to return, the same as the LOOKUP value in VLOOKUP()

so for example;
Dlookup("[Current]","[NECtable]","[Voltage]=" & [the voltage] & " AND [Horsepower]=" & [thehorsepower]) would return the value of [Current] from the table NECTable WHERE voltage = [thevoltage] AND horsepower = [the horsepower].
 
Thank you, I got Dlookup to work.
 

Users who are viewing this thread

Back
Top Bottom