Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding duplicate 'numbers'

Status
Not open for further replies.

nastar1

Technical User
Nov 1, 2005
122
0
0
US
Users are reporting cases where two identical 'SEQ' numbers are being assigned to different records.

This occurs when more than one user has the form open to create a new record. My Form_afterupdate code is below:

If Me.NewRecord Then
Me.FY.Value = CLng([FY])
Me.Seq = Nz(DMax("Seq", "tblWA", "[FY]='" & Me.FY & "'"), 0) + 1

Any tips on ways to keep this from happening?

I already have an autonumber field so I know the records are not a duplicate, but for the purposes of this database the customer doesnt want any record to share the 'Seq' field. The 'Seq' field is of type Number in the underlying table.
 
Why not simply use an AutoNumber field ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top