Formatting Autonumber

C

Chris

I am trying to set up a field in a database i'm creating
to generate a specific format the same way Autonumber will
generate a 1 then a 2 and so on. I want my format to come
out as J624C-742 then J624C-743 then J624C-744 and so on
and so forth down the column as you need to enter a new
record with that next number in the sequence. How would
you do this? I've been working on it for a while but have
gotten nowhere.
 
T

Tim Ferguson

I want my format to come
out as J624C-742 then J624C-743 then J624C-744 and so on

Case 1: the J624C- part is constant - don't store the prefix at all, but
use the Format property of the text box set to something like

"J624C-"000

Case 2: the prefix part is variable and has some meaning -- in which case
it should be in its own field(s) you can simply contcatenate the parts on
the forms and reports.

Hope that helps


Tim F
 
G

Guest

-----Original Message-----


Case 1: the J624C- part is constant - don't store the prefix at all, but
use the Format property of the text box set to something like

"J624C-"000

Case 2: the prefix part is variable and has some meaning - - in which case
it should be in its own field(s) you can simply contcatenate the parts on
the forms and reports.

Hope that helps


Tim F

The J624C- part is constant, but i'm trying to get the
742 number to come up in sequential order. How do i do
that?
 
T

Tim Ferguson

The J624C- part is constant, but i'm trying to get the
742 number to come up in sequential order. How do i do
that?

Use an autonumber. If you need more control than an AN gives you, then
there are lots of examples of VBA code that will generate equivalents. Try
googling for "Access Custom Autonumbers".

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