Automatically Generate Number On Form

  • Thread starter Thread starter jmpinto
  • Start date Start date
J

jmpinto

I have a field on a form that I would like to automatically generate a
number, in sequential order, each time a new record is created, and be
stored in a field. The problem is that I do not want this field to be
an autonumber field because if a new record is opened by mistake and
then not used, the autonumber's field would not be in sequential order
any more. Is there a way to do this? Maybe something along the lines
of matching the actual record number that is displayed by the record
selection buttons at the bottom of the page? Any ideas on this would
be greatly appreciated. Thanks!
 
I've got a free sample Access invoices database that does this on the
invoice form (frmInv) that you can download from my site and possibly
use as a starting point for your database:

www.Bullschmidt.com/Access

And the trick to making it work is this in frmInv's InvNum control's
DefaultValue property:

=Nz(DMax("[InvNum]","tblInv"))+1

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 

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

Back
Top