Hello,
We are running a database that is accessed by up to 4 users at any one time. The main table (tblCaseData) in the database has a primary key (JobNumber - long integer) that is incremented without the use of Autonumber. The below code updates that number when a new record is saved :
Set db = CurrentDb()
Set recordlist = db.Openrecordset("SELECT Max(tblCaseData.JobNumber) AS MaxOfJobNumbers FROM tblCaseData")
JobNumber = (recordlist!MaxOfJobNumbers + 1)
recordlist.Close
Set recordlist = Nothing
Our problem arises when multiple users are keying info. One user will use a JobNumber before the other and the save record will not be allowed.
What is the proper way to accomplish this?
Thank You
We are running a database that is accessed by up to 4 users at any one time. The main table (tblCaseData) in the database has a primary key (JobNumber - long integer) that is incremented without the use of Autonumber. The below code updates that number when a new record is saved :
Set db = CurrentDb()
Set recordlist = db.Openrecordset("SELECT Max(tblCaseData.JobNumber) AS MaxOfJobNumbers FROM tblCaseData")
JobNumber = (recordlist!MaxOfJobNumbers + 1)
recordlist.Close
Set recordlist = Nothing
Our problem arises when multiple users are keying info. One user will use a JobNumber before the other and the save record will not be allowed.
What is the proper way to accomplish this?
Thank You