autonumber

A

andymed

I have a prime number (autonum) in format "IF-04-"000 so
it reads as IF-04-001 next record IF-04-002 and so on.
Once it becomes 2005 I need to change to IF-05-001 and
continue like i did from the beginning. Not only changing
the 05 but also starting it at 001 again.
 
R

Rick Brandt

andymed said:
I have a prime number (autonum) in format "IF-04-"000 so
it reads as IF-04-001 next record IF-04-002 and so on.
Once it becomes 2005 I need to change to IF-05-001 and
continue like i did from the beginning. Not only changing
the 05 but also starting it at 001 again.

You cannot do this with an AutoNumber. Change it to a Long Integer and
then use code in your form when records are inserted to calculate the next
number to use.

If the prefix "IF-" is never going to change you don't need to store that
at all. If it were me I would also store the two other numeric "pieces" in
separate fields and then concatenate them together in the desired format
for display on forms and reports. That would make calculating the next
number a lot easier by being able to use DMax() on the two individual
fields to determine what the next value should be for both fields.
 

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