I am writing a collecting program and I need a way to add the entries up. I want to type in a number and have it automatically add to the total. I am trying to do this without using any VB if at all possible.
Could you clarify more of what you are trying to accomplish?
Where do you need the entries added together and output to? I would avoid making any fields in a table with the purpose of holding a result of a calculation.
I will be creating a query to hold the calculation. What it is I actually need is a way to start with 0 total. I will have a field on the form to enter the number of items being added to the inventory. I just haven't been able to get it to add to the total in the query without doubling up the total.
"SELECT Sum(Amount) as Total FROM MyTable;"
The query will return the total amount entered for each record (ie. =15). You can discriminate the item by adding a WHERE clause to the SQL (ie. WHERE Name = 'hat').
Your are on the right track. Is the field "hat" in the query only or have you added it to the table. I really don't want a permanten record of the amount added, only the total. That way when i pull this item up again I will be able to add more to the total.
The inventory table has a record referencing "hat". The 5 represents the number of hats in the inventory. In which case, the query I provided is not needed.
However, if you change the total number of "hats" in the table, there will be no record of the change. Are you sure you don't want to track how your inventory was altered and when? This will not help your paper trail if this is the case.
If this is the case, simply choose an unbound field to store the amount of inventory to add or reduce and update the 'Amount' field appropriately depending on the item.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.