rangersedge
Registered User.
- Local time
- Yesterday, 22:29
- Joined
- Jun 13, 2014
- Messages
- 82
I have a DB that is used by multiple people. It has a "PO" field that uses a VBA code to generate the next number instead of Autonumber due to needing the numbers to actually be in order. The problem is that if 2 people are creating new records at the same time then it will create the same PO number twice. I cant have the same PO number repeated. So how do I prevent this from happening? Is there a way to lock the new number as soon as the person BEGINS creating the record instead of when the record is saved?
Here is the "Autonumber" code that I'm using...
Private Sub Form_Current()
If Me.NewRecord = True Then Me.PONumber = Nz(DMax("PONumber", "POLog")) + 1
If Me.NewRecord = True Then Me.Requestor = UserOnName
End Sub
Here is the "Autonumber" code that I'm using...
Private Sub Form_Current()
If Me.NewRecord = True Then Me.PONumber = Nz(DMax("PONumber", "POLog")) + 1
If Me.NewRecord = True Then Me.Requestor = UserOnName
End Sub