Variable Formula Dependent on Field Value

M

MBoozer

I am setting up a dbase to calculate the amount of air emissions when using
paint in an autobody shop. The equation (formula) varies depending on whether
or not the paint has less than 33% total solvents or greater than 33% total
solvents. Paint contains many different solvents. Any idea on the best
approach?

I am thinking that perhaps I total solvent A + solvent B, etc and then use
an IF statement such as IF TOTAL solvent >33% use equation A or IF total
solvent <33% use equation B. I know to do the total solvent equation in the
query. Can I put the IF statement in the query as well and if so, what would
be the syntax for doing this. Here is abstract code of what I am trying to
accomplish:

IF (Solvent A + Solvent B) > 33% then (Run Emission Formula A) OR IF
(Solvent A + Solvent B) < 33% then (Run Emission Formula B) Thanks.
 
J

Jeff Boyce

Sounds like something you could do in a query, using the IIF() function.
Check it out in Access HELP.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
 
M

MBoozer

Thanks Jeff. I'll have to wait though since for some reason my Help files
won't work when I press F1.
 
J

Jeff Boyce

Try opening a code module and clicking Help.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top