G
Guest
I append data (using DoCmd.RunSQL) to table JobsContWorks which has the
following fields:
ContValID (fk)
WorksID (pk - autonumber)
ParentID (for generating treeview)
OrderID (for generating treeview)
WorksName
This newly created record then needs adding to the Treeview. To do this, I
need to get the WorksID of the record just added. The only way I can think of
doing this is by finding the max WorksID. However, this is a multi-user
database so it is possible that two people may be adding records at the same
time. Potentially, the max WorksID will not be the record just added. Is
there any other way I can get the WorksID?
Just to clarify, my code goes:
DoCmd.RunSQL(strSQL) 'This appends the record using the generated SQL
<....... Some code using the WorksID of the record just added ...........>
Thanks,
Dave
following fields:
ContValID (fk)
WorksID (pk - autonumber)
ParentID (for generating treeview)
OrderID (for generating treeview)
WorksName
This newly created record then needs adding to the Treeview. To do this, I
need to get the WorksID of the record just added. The only way I can think of
doing this is by finding the max WorksID. However, this is a multi-user
database so it is possible that two people may be adding records at the same
time. Potentially, the max WorksID will not be the record just added. Is
there any other way I can get the WorksID?
Just to clarify, my code goes:
DoCmd.RunSQL(strSQL) 'This appends the record using the generated SQL
<....... Some code using the WorksID of the record just added ...........>
Thanks,
Dave