2 Replies - 1826 Views - Last Post: 17 April 2012 - 06:29 AM Rate Topic: -----

#1 mazemutaze  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-April 12

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?
Is This A Good Question/Topic? 0
  • +

Replies To: Adding & Deducting Quantities in VB6 & Access

#2 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 826
  • Joined: 16-September 09

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 :)
Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1