473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Subtracting from units In Stock

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
3 1332
jamesd0142
469 256MB
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
Killer42
8,435 Expert 8TB
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
866 512MB
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

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

Similar topics

0
by: Marion Slaughter | last post by:
----FA48570F00BB51C Content-Type: text/html; charset="iso-35B2-E" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>...
7
by: simon | last post by:
Hi I know this has been done to death....but obviously at some point in the dim and distant past! I wish to program a retail database for my shop, I have trawled many forums and I only manage...
6
by: Phreake | last post by:
Hi Guys, I am doing a stock list of Printer tonors, with the following tables Printer_tonor_Stock Tonors Printers ----------------------------- ------------- --------------...
2
by: TheSeeker | last post by:
Hi, As part of a larger project, I am trying to use the GNU Units program to provide unit conversions between quantities. My first iteration, which worked OK, was to simply use units as a...
3
by: Martin Joergensen | last post by:
Hi, Just a small problem (about taken the previous unsigned value in a 1D- array and copying it to the current value). Suppose there's an outer loop over the line shown below, so...
1
by: savvy | last post by:
I am developing a Garments shopping cart. On the single product page where the customer selects size and colour of a garment and if its ok for him, then adds to his basket, so every time he checks...
5
by: kalyxo | last post by:
Hi all! For one of our web-communities we plan an offer of real time stock quotes incl. advanced notification services. I have the following questions: - Do you know of any services, that...
1
by: asmusdk | last post by:
I am working on creating a stock management database for a small company. The company receives the merchandise from a handful of suppliers and stocks it before it is sent to the customers –...
40
by: sazd1 | last post by:
Hi Student2 I am working on similar kind of thing for stock calculation but could not find any solution to my problem even after putting my problem to different forums. I saw your post that you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.