Sequencial Numbers?

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I am trying to assign sequencial numbers into my table, using a number
format. I do not want to use autonumber for this purpose. I have placed
this code into Default of my form with the intention of automatically
entering a sequencial number each time a new record is entered.
=DMax("CounterID","Analysis Form") I have tried several variarions with no
success. Nothing happens. What do i need to do. Thnaks...Randy
 
Try modifying this to increment it by 1:

=DMax("CounterID","Analysis Form") +1

Also "Analysis Form" should be the name of a table or a query?
 
Analysis Form is the table, I did include +1 at the end exaclty as stated,
but nothing happens....
Sandra Daigle said:
Try modifying this to increment it by 1:

=DMax("CounterID","Analysis Form") +1

Also "Analysis Form" should be the name of a table or a query?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I am trying to assign sequencial numbers into my table, using a number
format. I do not want to use autonumber for this purpose. I have
placed this code into Default of my form with the intention of
automatically entering a sequencial number each time a new record is
entered. =DMax("CounterID","Analysis Form") I have tried several
variarions with no success. Nothing happens. What do i need to do.
Thnaks...Randy
 
Interesting, so in the default value property of your CounterId control you
have the previously given code and when you move to a new record the number
doesn't increment?

Make sure that CounterID is a numeric field. You may also want to wrap the
function call with the NZ function - if your table is empty then the Dmax
function will return Null and that may be what is causing the problem:

=nz(DMax("CounterID","Analysis Form"),0) +1

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Analysis Form is the table, I did include +1 at the end exaclty as stated,
but nothing happens....
Sandra Daigle said:
Try modifying this to increment it by 1:

=DMax("CounterID","Analysis Form") +1

Also "Analysis Form" should be the name of a table or a query?

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I am trying to assign sequencial numbers into my table, using a number
format. I do not want to use autonumber for this purpose. I have
placed this code into Default of my form with the intention of
automatically entering a sequencial number each time a new record is
entered. =DMax("CounterID","Analysis Form") I have tried several
variarions with no success. Nothing happens. What do i need to do.
Thnaks...Randy
 
Back
Top