G
Guest
I am entering information into two tables (Sales and Forecasts). The Sales
table has an autoincrement field (RecordID). RecordID is then used as a
Foreign key in the second table (where it is a normal long).
I am using excel as a front end, and ADO to connect to the database. My
code currently works as follows.
1) Insert into the Sales table.
2) Query the Sales table to get the RecordID.
3) Insert into the Forecasts table.
The problem I'm having is that step 2 is often failing. It appears that the
information hasn't been "fully" inserted into Access, and therefore the query
returns no records.
I would prefer not to get the number manually, as it is possible that two
users will be inserting at the same time, and I'm worried the numbers will
get confused.
How do I get the autoincrement number successfully?
Thanks
Derek
table has an autoincrement field (RecordID). RecordID is then used as a
Foreign key in the second table (where it is a normal long).
I am using excel as a front end, and ADO to connect to the database. My
code currently works as follows.
1) Insert into the Sales table.
2) Query the Sales table to get the RecordID.
3) Insert into the Forecasts table.
The problem I'm having is that step 2 is often failing. It appears that the
information hasn't been "fully" inserted into Access, and therefore the query
returns no records.
I would prefer not to get the number manually, as it is possible that two
users will be inserting at the same time, and I'm worried the numbers will
get confused.
How do I get the autoincrement number successfully?
Thanks
Derek