Hello Everyone
I'm currently busy doing a program that can capture sales, and evrything is working fine at the moment. The only problem is that in the stock table I can't update the quantity(when the company purchases stock), and also can't decrease the quantity(when they are sales). If I were to get this one, I would have championed my project.
PLEASE HELP!!!!!

Hello Everyone
I'm currently busy doing a program that can capture sales, and evrything is working fine at the moment. The only problem is that in the stock table I can't update the quantity(when the company purchases stock), and also can't decrease the quantity(when they are sales). If I were to get this one, I would have championed my project.
PLEASE HELP!!!!!

You need to use the SET command. (I will not get too complicated but you need to be aware that one transactions depends on another)

If you use something like

Update StockTable Set Quantity = x

where x is the value you want you should be fine.

Hi Tony

Thanks for the help, but I still have a problem because basically, I need a mechanism that can hold the value in the program, so that each time something is purchased or sold, that value can be changed, I don't know if it makes sense, but if I can hold the database value and be able to subtract and add, using the vb6.0, then i'd be ok.

Dim MyValue As Double 'for decimal places else integer if inventory not to execeed 32k+ or then long

MyValue = MyValue + Quantity '5 + -5 = 0 5 + 5 = 10

Update Table Set field = MyValue

Or you can just keep a recordset in memory and then refresh it once you do an update statment which would be...

rs.refresh

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.