Using an update query to update amount in stock automatically


seagulls soaring

I have created a database to keep a track of orders.
In the stock table I have a field called amount in stock.
In order table I have a field called order quantity.
I have created an update query to update amount in stock to [amount in
stock]-[order quantity].
I wish to create a macro to run the update query on my order form once the
sale is confirmed.
My problem is that I want to just update the single record on the order
form, and not all items of stock from all existing orders.
I know I can add a parameter criteria to my update query (i.e. enter order
number) so that only stock relating to that order is updated, but I want a
more elegant solution that does not involve re-entering the order number. Any
help, most welcome.



It sounds to me like you are working on the table ??.

You should create a query based on the table and then a form based on that.

It is a very simple operation to have a reducing stock based on orders.

If you look around this forum some people will say it's best to have the
calculations in he base query and other will do them in the form. Bascially
it;s up to you. BUT don't work on the table.

I can't see your application but all you need to an updated stock level you
don't really need an update query.

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

Similar Threads