Icehousman2
Registered User.
- Local time
- Today, 08:30
- Joined
- May 12, 2004
- Messages
- 45
Here is my problem. I have three tables. tblOrder, tblProduct, and tblOrderDetails. tblOrder and tblProduct have a many-to-many relationship so I created tblOrderDetails that contains both primary keys from the other tables. The primary key in tblOrder is two fields OrderID(autonumber) and AgentID(Number). The primary key in tblProduct is ProductID(number). Now on the form for the user , I have a series of checkboxes to determine which product(s) are going with the order. I then have a submit button that checks which checkboxes are checked and inputs information into the tables accordingly. Using the following code.
Set mydb = CurrentDb
Set myset = mydb.OpenRecordset("tblOrder")
My problem is that the OrderID field is an autonumber field but needs to be inputted in two tables. How do I input the same number in both tables, when I am not specifying what the number is? Is there a way to get around this? Or am I going to have to change how I’m going about this. Thanks for the help in advance.
Set mydb = CurrentDb
Set myset = mydb.OpenRecordset("tblOrder")
My problem is that the OrderID field is an autonumber field but needs to be inputted in two tables. How do I input the same number in both tables, when I am not specifying what the number is? Is there a way to get around this? Or am I going to have to change how I’m going about this. Thanks for the help in advance.