G
Guest
I'm using Access 2003. I have a very simple data base that several user will
need to use. The database is on a file server and a few user will access this
database.
Basically I need to increment a number (+1, starttng at 500) everytime a
user click on "Submit". The number must be saved on a table so next time a
user opens the database and click on submit, the last number is incremented
(+1). This number is then saved on different table with more information.
What would be the best way to do it ? How can I avoid to have duplicates
numbers ?
The below obvioulsy does not work as numbers can be duplicates (it also save
all numbers which I do not need, I just need the last one) :
Set rstIDLog = db.OpenRecordset("tblIDLog")
rstIDLog.MoveLast
intNewID = rstIDLog("IDProblem") + 1
rstIDLog.AddNew
rstIDLog("IDProblem") = intNewID
rstIDProblem.Update
need to use. The database is on a file server and a few user will access this
database.
Basically I need to increment a number (+1, starttng at 500) everytime a
user click on "Submit". The number must be saved on a table so next time a
user opens the database and click on submit, the last number is incremented
(+1). This number is then saved on different table with more information.
What would be the best way to do it ? How can I avoid to have duplicates
numbers ?
The below obvioulsy does not work as numbers can be duplicates (it also save
all numbers which I do not need, I just need the last one) :
Set rstIDLog = db.OpenRecordset("tblIDLog")
rstIDLog.MoveLast
intNewID = rstIDLog("IDProblem") + 1
rstIDLog.AddNew
rstIDLog("IDProblem") = intNewID
rstIDProblem.Update