Unanswered: Adding data using textboxes and comboboxes on a form
I'm having trouble writing the code in the commandbutton to copy the data from the form to the desired forms. None of the textboxes or combo boxes are bounded because I need to to change information on various forms. The combo boxes take information from a table. When I click the commandbutton, there is no error message, but the information isn't added to the "Takeout_History" table. In fact, nothing happens. This is my code so far:
Private Sub Command17_Click()
Dim rstTakeout_History As DAO.Recordset
Set rstTakeout_History = CurrentDb.OpenRecordset("Takeout_History")
!Date.Value = Text18
!Name_Worker = Text7
!Name_Product = Combo0
!Name_Model = Combo2
!Amount = Text15
!Unit = Text12
Update: Turns out it works, but the results don't show up in the table until I close it and reopen it. Is there anyway I can have it show up immediately after I click? I think the .update did that for me.
So what would be a better way to do this? I have a form that has two combo boxes to run a query to pick out an object from the inventory table. Then the about that is taken out at that time of that object will be put in a textbox and subtracted from the amount in the inventory (I haven't figured out how to do this yet. I'm fairly new to access. Any help on this part would be great because I'm gonna be posting on here about it eventually). This information, the two combo boxes and the textbox, will be entered into a new table and recorded along with the time.
And can access do math like excel? My idea for the first part was to run a separate query from the inventory table and use the two combo boxes as criteria. This will isolate one single object in the query. Then I would apply the subtraction to the item in the query and that will update the same item in the inventory table. Is that possible?
Inventory apps are not for the faint-of-heart. I would generally advise against storing the quantity on hand, and I haven't in the inventory apps I've created. You calculate it from transactions. Here's an often cited link that discusses the topic: