Auto Numbers with a Default value ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use an Auto Number field which should be as follows .
If Auto number is 1 , it should be MH 0001.
If Auto number is 2, should be MH 0002.
If Auto number is 10, it should be MH 0010.
and so on.
how can I get like above ?
 
You can't. AutoNumbers can't be modified for your own purposes.

AutoNumbers exist for one purpose only: to provide a (practically
guaranteed) unique value that can be used as a Primary Key. In fact, it's
rare that the value of the AutoNumber field is even shown to the end users.

If the value of the AutoNumber field is important to you, you probably
shouldn't be using an AutoNumber.
 
Hi,
If Auto number is 1 , it should be MH 0001.
If Auto number is 2, should be MH 0002.
If Auto number is 10, it should be MH 0010.

if you need the "MH *" in a form or report just change the query in this
way:


SELECT XXXX, XXXX, XXXX, "MH " & table.AutoNumberFieldWithOnlyNumbers
FROM table;

HTH.

Thomas
 
In the FORMAT property put --
"MH "0000

Just remember that if a user moves to a new record the number will be
incremented even if nothing is entered in any field and the record not saved.
There will be gaps in your number sequence.
 
KARL said:
In the FORMAT property put --
"MH "0000

Just remember that if a user moves to a new record the number will be
incremented even if nothing is entered in any field and the record
not saved. There will be gaps in your number sequence.

True, but the user will have to make an entry. Just navigating to the new
record position does not consume an AutoNumber unless the form is dirtied.
 
Back
Top