Expand|Select|Wrap|Line Numbers
- Add new Item "New Item"
- Edit Item "Edit Item"
- Delete Item "Delete Item"
- Update Item "Update Quantity"
- Add one to Item "+1"
- Subtract one from Item "-1"
However the Edit Item, Update Item, +1, and -1 don't work properly. I have created a simple form with a combo box that runs on the cmd, after you select the item to be updated it runs a query to update the given changes. The queries have a parameter in them that is taken off of the select form. Where my problem lies is that it wont select a certain item as the user does. It always defaults back to the first Item on the table and updates it instead. Why is this and what do I have wrong.
CMD on "Edit Item"
Expand|Select|Wrap|Line Numbers
- Private Sub cmdEdit_Click()
- On Error GoTo cmdEdit_Click_Err
- DoCmd.SetWarnings False
- DoCmd.OpenForm "frmitem select3"
- cmdEdit_Click_Exit:
- Exit Sub
- cmdEdit_Click_Err:
- MsgBox "Inserted Invalid Item Name"
- DoCmd.CancelEvent
- DoCmd.SetWarnings True
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub cmdselect_Click()
- DoCmd.OpenForm "frmEdit Item", , _
- "Item Name Description =" & Me.ItemSelect
- End Sub
Expand|Select|Wrap|Line Numbers
- Nomenclature TEXT
- Item Name Description TEXT
- NSN TEXT PK
- Reorder Level NUMBER
- Target Level NUMBER
- Quantity Per Unit NUMBER
- Available Inventory NUMBER
- Category TEXT/LIST (COMBO BOX ON FORM)
- Company TEXT
- Company Site HYPERLINK
- Product ID TEXT
- Standard Cost CURRENCY
- Details TEXT
Expand|Select|Wrap|Line Numbers
- Private Sub cmdupdate_Click()
- DoCmd.SetWarnings False
- On Error GoTo cmdupdate_Click_Err
- DoCmd.OpenForm "frmItem Select1"
- DoCmd.Requery
- cmdupdate_Click_Exit:
- Exit Sub
- cmdupdate_Click_Err:
- DoCmd.CancelEvent
- DoCmd.SetWarnings True
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub cmdselect_Click()
- DoCmd.OpenQuery "qryupdate Inventory"
- DoCmd.Close
- DoCmd.Requery
- End Sub
Expand|Select|Wrap|Line Numbers
- UPDATE [tblInventory Totals]
- INNER JOIN [tblExpendable Inventory]
- ON [tblInventory Totals].NSN = [tblExpendable Inventory].NSN
- SET [tblInventory Totals].[Available Inventory] =
- [Available Inventory]+[Amount to add to value]
- WHERE ((([tblExpendable Inventory].[Item Name Description])=
- [Forms]![frmItem Select1]![Item Name Description]));
Sgt B