By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

Subtracting from units In Stock

P: 1
I am having problems subtracting from unitsInStock for all records on my table, for instance; I have Quantity sold, Unit Price,UnitsInStock,Total sales, Stock Balance.

I declared
Dim num1
Dim num2
Dim num3
As General Declaration, then on form load

I wrote
num1 = quantity Sold
num2 = unitsInStock
num3 = Stock balance
num3 = num2 - num1

it worked just once and do not work anytime I update, again it dont work for all my records. Can anyone help please?
Jan 9 '08 #1
Share this Question
Share on Google+
3 Replies


jamesd0142
100+
P: 469
I am having problems subtracting from unitsInStock for all records on my table, for instance; I have Quantity sold, Unit Price,UnitsInStock,Total sales, Stock Balance.

I declared
Dim num1
Dim num2
Dim num3
As General Declaration, then on form load

I wrote
num1 = quantity Sold
num2 = unitsInStock
num3 = Stock balance
num3 = num2 - num1

it worked just once and do not work anytime I update, again it dont work for all my records. Can anyone help please?
Ok so you have a table which stores your data, and you want to update the values in the table through vb? if no can you explain what you want?
Jan 9 '08 #2

Expert 5K+
P: 8,434
Yes, keep in mind that the Form_Load event only occurs when the form is loaded (strange, huh). From the sound of it, you want to do this in an event that is triggered when you change between records or something.

I think we'd need more detail on your situation to provide much more help.
Jan 10 '08 #3

lotus18
100+
P: 866
Yes, keep in mind that the Form_Load event only occurs when the form is loaded (strange, huh). From the sound of it, you want to do this in an event that is triggered when you change between records or something.

I think we'd need more detail on your situation to provide much more help.
Yes, I agree with you Killer42.

Hey nicekul, why don't you use command buttons for that?

Rey Sean
Jan 10 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.