Autonumber

R

Rab

Hi,
Im trying to setup a database to auto generate the next number in sequence
as follows:

XXX\XXX0001 , where X is a fixed character and the value (last 4 digits)
must display 4 digits.

Ive tried using the dmax function but brings back an error in the field.

Any help would be apreciated.

Thanks
 
R

Rab

Hi, thanks for replying.
Ive given up on autonumber, and used a text field instead. In the form,
im using the formula: = DMax("[FIELD]", "
") + 1. Ive done as you
suggested and removed the XXX\XXX from the prefix. The problem Im now having
is that it cant seem to display 4 characters for the number ie 0001. If I
enter 0001 for the 1st record, the 2nd is set to 2, instead of 0002 (Ive
tried both text & number field types). I know is sounds pedantic, but the
number must contain 4 characters and I cant figure out how. Any help on this
would be appreciated.

Thanks
Rab
 
R

Rab

Thanks for your help Joseph,
Managed to sove the problem by entering 0000 into the format property.

Cheers
Rab

Joseph Meehan said:
Rab said:
Hi, thanks for replying.
Ive given up on autonumber, and used a text field instead. In the
form, im using the formula: = DMax("[FIELD]", "
") + 1. Ive
done as you suggested and removed the XXX\XXX from the prefix. The
problem Im now having is that it cant seem to display 4 characters
for the number ie 0001. If I enter 0001 for the 1st record, the 2nd
is set to 2, instead of 0002 (Ive tried both text & number field
types). I know is sounds pedantic, but the number must contain 4
characters and I cant figure out how. Any help on this would be
appreciated.

Thanks
Rab


Remember that the number 0002 is really just 2 There is no "number"
0002. Access can display 0002 for a number if you define the display
format for it in the form etc where it is being displayed.

There are several options for maintaining the 0002 format when combining
fields depending on the situation. I have not had to bother with it so my
memory is a little foggy on the details. I will hope that someone comes
along with a good working answer for you soon. If not I will try to
remember to come back and look it up. Remember that you can convert numbers
to text, I suspect that will be part of the answer.
 

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