sequence

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.
 
V

Van T. Dinh

.... provided that it is a single-user database. In multi-user database,
this algo can lead to duplicated values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top