Adding & Deducting Quantities in VB6 & Access

Posted 15 April 2012 - 11:37 PM

I have a real simple project I'm doing using VB6.0. Its a book store inventory. I'm using MS Access as my database. At the moment all I have is entering of records into fields and saving them in the database. I'd like to put coding to deduct from the inventory when a book is purchased and add again when stock comes in. Can anybody help me?

Replies To: Adding & Deducting Quantities in VB6 & Access

Re: Adding & Deducting Quantities in VB6 & Access

Posted 16 April 2012 - 08:48 AM

You would have to do the following;

1. Query the existing results in the Access table to see how many of Book "X" are in stock.
2. Create a variable that represents the difference of the query results and the calculation in either direction.
3. Update the table with the new results so Book "X" now has this many in stock.

Some helpful functions for this

rs.addnew
rs.update
rs.find

Try putting the function to do this together and see how it works. Once we see some code, we can always be more specific with the help

Re: Adding & Deducting Quantities in VB6 & Access

Posted 17 April 2012 - 06:29 AM

Please don't send personal messages asking for help on matters like these. I'm sure that you understand when you think about it that any help you are given is to be shared with the entire community. We can't do that very well if we communicate privately.