C
cyberpyxi via AccessMonster.com
I am having an Update Query issue. I have a Calls form that holds 5 chemicals
and the quantities used of each. I need these quantities to be subtracted
from the Inventory table as I enter calls.
I made a simple Update Query but am receiving undesirable results.
Because there are the 5 spots to enter chemicals, I made 5 update queries.
They preform properly in that the most recent quantity is (ultimately) the
final number put into the Inventory table, however, that is only per column.
If AA5015 was used in the most recent record of Calls, and the ending
quantity on hand is 15, that is the number put into Inventory table for that
item, unless AA5015 was used in a previous record but in Chem2, Chem3, Chem4,
or Chem5.
Any suggestions on how I can make this work? There will never be a time where
the same chemical will be used twice on one record, if that helps.
The only thing I can think of is to do a MAXCallsID query that will take the
highest AutoNumber (Primary Key) from the Calls and use that as the updating
factor and then to put that in the Update query, but I am unsure how to
properly do so. I keep getting errors with it. The MAXCallsID will pull up
the Chem1 ID and QOH for it properly, but I can't seem to integrate it into
an Update.
Ideas?
and the quantities used of each. I need these quantities to be subtracted
from the Inventory table as I enter calls.
I made a simple Update Query but am receiving undesirable results.
Because there are the 5 spots to enter chemicals, I made 5 update queries.
They preform properly in that the most recent quantity is (ultimately) the
final number put into the Inventory table, however, that is only per column.
If AA5015 was used in the most recent record of Calls, and the ending
quantity on hand is 15, that is the number put into Inventory table for that
item, unless AA5015 was used in a previous record but in Chem2, Chem3, Chem4,
or Chem5.
Any suggestions on how I can make this work? There will never be a time where
the same chemical will be used twice on one record, if that helps.
The only thing I can think of is to do a MAXCallsID query that will take the
highest AutoNumber (Primary Key) from the Calls and use that as the updating
factor and then to put that in the Update query, but I am unsure how to
properly do so. I keep getting errors with it. The MAXCallsID will pull up
the Chem1 ID and QOH for it properly, but I can't seem to integrate it into
an Update.
Ideas?