Update Query - When to Run?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

You help is appreciated.

I am logging out parts from inventory on a form. Then I want to run an
update query that deducts the qty logged out from the qty on hand. My
problem is figuring out when to run the query. I am getting inconsistent
results and deleting the amounts more than once in some cases. I tried to do
it in the forms After Update and OnLostFocus events.

Look forward to hearing from you and thanks in advance.
 
The best answer might be NOT to store the quantity at all, but rather to
calculate it when needed.

There's an example of how to do that in this article:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html

If you want more than that, buy John Viescas' book "Building Ms Access
Applications" (Microsoft Press, 2005). There is a sample database on the
disk that assigns product from inventory to orders, so you can think of the
book as brilliant documentation on how to do this, and you get the database
(and others) for free.
 
Thank you Allen, I figured it out. I thought of it like I was working in
dBase and got it. I keep a table as a repository for changes, run the update
query after closing the form, append the changes to the permanent table and
then delete the repository so I have a clean set of records every time I go
in and out of the form. May not be the proper way to do it but it work for
me. Now I can go to bed! I had to have this done by in the morning.

Thanks so much for your help.

Bonnie
 
Back
Top