Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtract Inventory Qty from Sales Order

Status
Not open for further replies.

kramsey

Technical User
Jan 16, 2003
5
US
I have created a sales order form which pulls information from a inventory table. With each stock item entered on the sales order I have created a command button that subtracts the quantity ordered from the qty on hand in the inventory table.

My problem is that I want to keep the user from subtracting the qty more than once. Is there a If...then statement I can use to do this or is there a better way to handle this situation.?
Any help would be greatly appreciated.
 
kramsey,

You have to be very careful with your process when you are performing updates to tables. The process needs to allow the user to make changes in the interface without affecting the underlying data (table) UNTIL the entire transaction is committed. THEN you want to be ABSOLUTELY CERTAIN that EVERY ITEM THAT SHOULD BE PROCESSED, IS PROCESSED WITHOUT INTERRUPTION. This is often done with BeginTrans, CommitTrans and Rollback Methods.

How does your user interface process work?


Skip,
Skip@TheOfficeExperts.com
 
Thank you for replying.

My user interface consists of a form which is created from a query on the customer table and sales order table. There is a subform attached which comes from a query on sales order line items and stock. The user is able to select a stock item and enter a quantity. After they have entered in the qty and price there is a command button which subtracts the quantity from stock.

I am not familiar with BeginTrans, CommitTrans & Rollback methods. Can you give me a sample?

Thank you again.
 
It's all in VB Help.

If the Command Button subtracts the quantity from on-hand inventory, once the button is pressed, the form must not remain in its former state that allows additional keying of that function. You might give a confirmation that the transaction was processed, clear the form in anticipation of a transaction of another item OR a different form might be displayed. I don't know what your process dictates.

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top