Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms to quickly increase/decrease amounts in a table

Status
Not open for further replies.

TitanMan

Programmer
Oct 9, 2006
16
US
I am modifying the Assets database (template in Access 2007 beta). I have added Qty as a field in the Assets table and all related forms/reports. Currently, the Asset List form allows me to pull up the an item and edit the Qty field directly (ie, I could change QTY from 10 to 20). However, I would like to build a Add Qty form which would allow me to put a number in the QTY field which would add that number to the current value of the QTY field (ie I have 10 apples, I open the Add Qty form and in the the QTY field of Apples product I would type in 15 (now my total QTY is 25 apples). Likewise I would like to have a Remove Qty form to remove Qty in a similiar fashion.
 
Why not just add an unbound textbox to your form that modifies the quantity by the amount keyed in (+/-) in the AfterUpdate event of the unbound textbox?

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
We're on the same page with the unbound control. Can you be more specific? I could add the unbound control to QTY field value but how to do I set the QTY field value to the new value.
 
AfterUpdate event of txtModQuantity:
Me.Quantity = Me.Quantity + Me.txtModQuantity


HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
That would work for 1 item at a time but my project involves updating a list of items at a time. Sometimes, I may update more than 10 items sometimes only one or two. I would like to be able to type in multiple items at a time instead of navigating to each individual item in the form view. For example, I may get 5 Widgets, 10 Gadgets, and 4 Smidgets. I imagine a form with a DataGrid view, Column 1 = ModQuantity, Column 2 = Item (in a lookup field), Column 3 = CurrentQTY.
I realized I have just changed the complexity by a large factor but maybe I am suffering from "tunnel vision".
 
Have you tried putting your 3 fields in a SubForm of your mainForm? Without a better understanding of your table(s) it is difficult to offer more specific advice.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
The main form only has a single item. I do have a list form which has all of the items in a DataGrid view that I may have to modify with a subform. Thanks for the tip.

As far as details of this project:
I have a friend who is keeping an inventoried list of three categories of items. As his workers bring in Work Orders (basically a list of items and the quantity of each used) he changes the quantity of items in his three inventory lists.
I have played with the Assets template and it gets me 90% of the way. I could start from scratch with a simple table of Qty, Item, Category. He wants to be able to type in the qty and item name/number of each item on a form which would then modify the appropriate Qty fields in the Items table.
 
Try the SubForm idea. I have to leave for a few hours. I'll check in when I get back.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
Any luck with the SubForm idea?

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
Project postponed for about a week but I'll let you know as soon as I get back on it.
 
Thanks for the follow-up.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top