Both numbers are seen and used by the person inputting the data.
In my test in which i deliberatley got users to hit the button at exactly the same time the same numbers were generated.
Can you explain why saving the record with minimal information will reduce this risk? And what to do about fields which have validation eg (is not Null)
The duplicates in my tests were not saved because the ticket number field is indexed no duplicates. creating another issue the data has to inpuuted again.... Ah.. okay.. I see... yes you would avoid this issue of having to reinput the data. I am still not sure this method would work for me though
Here is what I am trying to achieve
Code:
Private Sub Numbers_Click()
If IsNull(Me![Ticket]) Then
IF the Maintable is locked pause for 200ms
While The MainTable is Locked Pause for 200ms
end while loop
End If
Lock the MainTable and dont allow any other users to read or write to it
Me![Ticket] = Nz(DMax("[TBLTicket]", "[Main]"), 0) + 1
Me![Counter] = Nz(DMax("[TBLCounter]", "[Main]", "[TBLDateOpened] = #" & Forms!Main!DateOpened & "# "), 0) + 1
Save the record
Unlock the mainTable
End If
End Sub