I have built a main screen for inventory items, and a pop-up that displays/enters transactions for each of those inventory items. I use the following code:
on the pop-up event to associate the new transaction record with the inventory item.
However, if I attempt to add another record to the transaction continuous form, I get an error, because Access doesn't know what the required InventoryID is for the new record.
What's the easiest way to associate the given inventoryID with every new transaction added? I attempted code similar to the above in AfterInsert code, but the Me.ID doesn't work any more, since we're no longer on the main screen. Did I do something wrong in the design of my database? Because this seems so straightforward. As far as I know, the Inventory and Transactions tables (the two main tables) do have the correct relationship set up.
Thanks in advance!
Code:
DoCmd.GoToRecord , , acNewRec
Forms!Transaction.InventoryID = Me.ID
on the pop-up event to associate the new transaction record with the inventory item.
However, if I attempt to add another record to the transaction continuous form, I get an error, because Access doesn't know what the required InventoryID is for the new record.
What's the easiest way to associate the given inventoryID with every new transaction added? I attempted code similar to the above in AfterInsert code, but the Me.ID doesn't work any more, since we're no longer on the main screen. Did I do something wrong in the design of my database? Because this seems so straightforward. As far as I know, the Inventory and Transactions tables (the two main tables) do have the correct relationship set up.
Thanks in advance!