By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

Automatically Generate Number On Form

P: n/a
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!

Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
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!


Nov 14 '05 #2

P: n/a
Paul,

The DMax command did the trick! I appreciate it! :) Take care!
Jonathan

pa**@bullschmidt.com wrote:
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


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.