sequence

  • Thread starter Thread starter Ashby
  • Start date Start date
A

Ashby

You could try something simple such as:
This code finds the largest number in the underlying table
and increments it by one.

On the "ON CURRENT" event of the form

If Me.NewRecord Then
YourField = DMax("YourField", "TableBoundtoForm") + 1
End If

This also works if you put it in as the field's default
value.
 
.... provided that it is a single-user database. In multi-user database,
this algo can lead to duplicated values.
 
Back
Top