Autonumber Field

R

Roger Bell

I have a design that includes a Field for Invoice Number that is
automatically generated. The problem is that if the user commences a new
Entry and then deletes the record, the Invoice number loses it sequence. For
example, it may jump from say 13 (last entry) to 15.

I know you can fix this by removing the autonumber field and then adding
again.

Is there any way that you can retain the Invoice numbers without gaps, no
matter what the user does wrong?
Thanks for any help
 
G

George

Dear Roger,

Since that number (invoice number) is essential for you then don't use
autonumber - use Number - Long Integer.

You When you will record new invoice the number must be MaxOfInvoiceNumber +1.

Also think about cancelling an invoice and not to delete it.

Hope this helps,

GeorgeCY

Ο χÏήστης "Roger Bell" έγγÏαψε:
 
T

tina

yes - don't use Autonumber for the Invoice. the Autonumber cannot be counted
on to deliver consecutive numbering, as you've already discovered; don't use
it for any value that is intended to be seen by, or have meaning to, the
user.

you can generate a "next number" for a record by assigning it
programmatically, as

InvoiceNumber = DMax("InvoiceNumber", "TableName")+1

there have been a lot of discussions on this topic in the newsgroups; rather
than rehashing the issues, suggest you google for more information.

hth
 

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

Similar Threads


Top