Manipulating Data in Access

RockDarkwater

New Member
Joined
Dec 17, 2015
Messages
6
I'm new to Access (moving over from Excel because the databases were too big) and I was wondering the best way to duplicate how excel manipulates data.

I have two tables that need to interact:

Table 1 - Gas Component Percentages in a sample (Methane, Ethane, etc.). Each sample processed is a record, each component is a column.
Table 2 - Gas Component constants (Molecular weight, Cubic Ft per Gallon, etc.). Each record is a component, each constant is a column.

How do I get a text box in a report or form to display the molecular weight of a sample? (Component Percent * Component Constant)

In excel, I'd write something like this:

=Hlookup("Methane", Table1!1:2, 2, False)*vlookup("Methane", Table2!A:B, 2, False)


Thanks in advance for the help!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Write a query that joins both tables and calculates the product (can also include distinctrow and transform/pivot). Access has dsum/dlookup functions but they're much slower.
 
Upvote 0
each component is a column.
This is often the paradigm of Excel users. db data is supposed to be structured as row based, not columnar. Your situation seems to require a junction table. You probably ought to have something like tblComponents and tblTests with a linking table tblTestComponents (or similar names). If I used Test and Component as examples but made up my own components for simplicity, then something like

tblTest
IDTestDate
TesterSampleNo
11/01/1814456
21/05/1815578
31/08/1828852

<tbody>
</tbody>


<tbody>
</tbody>
tblComps
IDComp
1methane
2ethane
3argon

<tbody>
</tbody>


tblTestComponents
IDTestID_FKComponent
111
213

<tbody>
</tbody>

Hope that provides some food for thought.
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,791
Members
449,188
Latest member
Hoffk036

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