I am a chemist attempting to load our lab’s data into an Access 2007 database and have hit a snag.
I have a table that contains the log numbers of all of my samples (Log#), the original sample they were produced from (RawMaterial), and the ID and concentration of up to three additives (Additive1, Additive2, Additive3 and Conc1, Conc2, and Conc3). On my form, when you select a raw material, I would like my form to auto-fill the fields for the additives and their concentrations using the same values as the raw material.
When I do this however, I would like to be able to edit the additive information. For instance, sample R031 might have 3% additive a. I want to make a new sample, call it R032, which is R031 with an additional 4% of additive b. When entering the information for R032, upon entering R031 into the raw material field, I would like Additive1 to show “additive a” and Conc1 to show “3%.” But then when I enter “additive b” and “5%” into Additive2 and Conc2, respectively, I want R032 to reflect the presence of two additives but R031 to be unchanged.
I figured I might need a query that accepts the raw material as a parameter and then looks up the additives for that raw material. On my form (QueryTest), I have a combo box that enables you to select the raw material (RawM) and a button to run the query. The query accepts [Forms]![ QueryTest].[RawM] as its criteria and shows the additives and their concentrations. However, when I run it, no records are returned.
My questions then are 1) What am I doing wrong with the query? and 2) How do I take the query results and copy them into the additive and concentration fields on my form? If the query route is not one I want to take, I'm open to trying something else, I just don't know what it might be.
I’ve been reading lots of tutorials and trying to google my question in creative ways but I can’t seem to find an answer. I would appreciate any advice you might have. Thanks very much!