Auto Increment Number

G

Guest

Can I make Access Auto Increment a 4 digit number at the next blank form. ie

When I start the secession I will type in the Visual Id #, say it is "7643".
Then when the record is saved and a new blank one opened, I would like the
form to open with a 7644 number already in the "VID" field.
 
J

Joseph Meehan

Try:

If Me.NewRecord Then

Me!NameOfField = Nz(DMax("YOURFIELDNAME","TABLENAME"), 0) + 1

End If

Replace the 0 if you want a different starting number


The following can be used to format the field with letters preceding the
number like ABC

=Format(NumField, "\A\B\C\-0000")
 
B

BruceM

The link I sent contains this information. It goes into the field's default
value, which can be set in the text box bound to the field.
 

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