auto number

G

Guest

I deleted out my auto number in my table and added a field
called Account number/text field.
My last account number is 470. In my next NEW record, how
can I get the last account number to add 4 digits and give
me 474, next new record 478. I know how to do this with
autonumber but not text. Thanks, SF
 
S

Steve Schapel

SF,

Any reason for choosing a text data type rather than number?

- Steve Schapel, Microsoft Access MVP
 
T

Tim Ferguson

My last account number is 470. In my next NEW record, how
can I get the last account number to add 4 digits and give
me 474, next new record 478.


= Format(DMax("CInt(AccountNumber)", "MyTable")+4),"000")

but you will need to trap the NULL error that occurs when entering the
first record in the table.

But I have to wonder, like Steve, why you chose a text field, when you want
it to count...

HTH


Tim F
 

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