Autonumbers Question

aqif

Registered User.
Local time
Today, 02:57
Joined
Jul 9, 2001
Messages
158
Hi
smile.gif
I've got two autonumber question:

1. How is it possible to get an autonumber in the shape of 00001 and 00002 etc. Or tell me if I have 1, how can I turn it into 00001 through function.

2. Is it possible to autonumbers like FM0001, FM 0002 etc?

Cheers!
Aqif
 
1) Me!AutoNumber = Format(CLng(Right(DMax("[AutoNumber]", "Table1",), 5)) + 1, "00000")

2) Me!AutoNumber = "FM" & Format(CLng(Right(DMax("[AutoNumber]", "Table1",), 5)) + 1, "00000")

You'll have to enter your own field and table names
 
You can also change it in the table design. 1) In your autonumber field, change the format to 00000 this will number them 00001.......06987 etc.
2) Changing it to "FM"00000 will number them FM00001.....FM06987 etc.Be aware though, If you ever have to link to the table using this autonumber field for the relatioinship, you will have to use Text and not Long Integer (default) which may throw up problems.

HTH
 

Users who are viewing this thread

Back
Top Bottom