Custom Counter

M

Mary

Is there anywhy to have a button that when clicked you get a form with a new
record that has a auto number already present. Currently were the auto number
would display i get (AutoNumber) I know it will update onces you type but i
want to be able to save a blank record that only contains the number. The
Records a profiles and sometime it is require to skip some and then come back
later to fill in the data.
 
J

Jackie L

The best way to do this is to not use an autonumber. That field type can be
problematic, and if you need sequential numbers, a deleted record number will
not be reused.

Instead on a button or other event, you can put:
DoCmd.GoToRecord , , acNewRec
Me.NumberFieldName = Nz(DMax("NumberFieldName", "tblTableName")) + 1

Hope this helps.
Jackie
 
B

banem2

Is there anywhy to have a button that when clicked you get a form with a new
record that has a auto number already present. Currently were the auto number
would display i get (AutoNumber) I know it will update onces you type but i
want to be able to save a blank record that only contains the number. The
Records a profiles and sometime it is require to skip some and then come back
later to fill in the data.

Hi Mary,

AutoNumber is written when first character is typed in new record.

You can go to new record and add Null value or zero length string to
any field which will trigger AutoNumber:

DoCmd.GoToRecord , , acNewRec
Me.txtFieldName = ""

or

Me.txtFieldName = Null

This will create new record with AutoNumber value, but leave all
fields empty.

If you are using this number as, for example, Invoice number you
should have a field with number controlled by program.

Regards,
Branislav Mihaljev
 
M

Mary

Thanks that solves my problem

Hi Mary,

AutoNumber is written when first character is typed in new record.

You can go to new record and add Null value or zero length string to
any field which will trigger AutoNumber:

DoCmd.GoToRecord , , acNewRec
Me.txtFieldName = ""

or

Me.txtFieldName = Null

This will create new record with AutoNumber value, but leave all
fields empty.

If you are using this number as, for example, Invoice number you
should have a field with number controlled by program.

Regards,
Branislav Mihaljev
 
Top