Locking a table
Locking a table
(OP)
I have a table that holds a value (lastidtab)--one record. In my program I have a command button assign the next id number by getting the value in the lastidtab and adding 1. It then updates the the lastidtab with the incremented number. And so on.
The problem I am having is that the user will often have the Access database open more than once on her desktop and it appears that the lastidtab is not being updated properly, because at a later time, when the user needs to assign another id number and then tries to save the data to the table with that id number, she gets a message that says the changes you requested to the table were not successful because it would cause duplicate values in the primary key etc. The ID field is the primary key. The Access database is on our network.
Is there a way either make sure a user can not open the Access database twice or somehow deal with the table not being updated properly?
Thank you!
The problem I am having is that the user will often have the Access database open more than once on her desktop and it appears that the lastidtab is not being updated properly, because at a later time, when the user needs to assign another id number and then tries to save the data to the table with that id number, she gets a message that says the changes you requested to the table were not successful because it would cause duplicate values in the primary key etc. The ID field is the primary key. The Access database is on our network.
Is there a way either make sure a user can not open the Access database twice or somehow deal with the table not being updated properly?
Thank you!
RE: Locking a table
Note the dbdenyread on the unique value table.
MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
RE: Locking a table
I thought locking the table would work, but it just locks someone out while accessing it which is not the problem. It's not two different users that's the problem, it's the same user having Access open twice and possibly flipping between the two open programs. The table is not updated in each open program.
Does your FAQ apply to that situation? Thanks