Navigation Button Problem

  • Thread starter Thread starter Sheldon
  • Start date Start date
S

Sheldon

I have a form with a navigation button. WHen the user
goes to create a new record, changes his mind and returns
to a previous record, then tries to add a new record. the
following happens

1. when the record is not created (I create the record and
then delete it, the record count for the number of records
in the collections does not get reduced by one. Not good.
How Do I get it to reduce.

2. when I try again to add a record, I am returned to the
deleted record and all by bound controls have in them
#Deleted. Also not good.

I want to reuse the record count number.

Hope I explained this properly

Thanks
 
If the 'record count number' that you refer to is an
autonumber field that Access is generating for you, it is
not truly a record count as it will not change as records
are deleted or things would really be a mess. An autonumber
field generates it's number as a record is created and then
will never reassign it again. If all the autonumbers are
lower than the last ones used but deleted, they can be
recaptured when you compact a database, but that won't help
you. If you need all numbers always to be sequential (not
sure why you would) you will need to come up with another
method.

You can also train your users to hit the Escape key twice so
the record is never 'committed' when they back out or handle
it with Me.Undo in code. The number should never be assigned
then.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
Gary Miller said:
If the 'record count number' that you refer to is an
autonumber field that Access is generating for you, it is
not truly a record count as it will not change as records
are deleted or things would really be a mess. An autonumber
field generates it's number as a record is created and then
will never reassign it again. If all the autonumbers are
lower than the last ones used but deleted, they can be
recaptured when you compact a database, but that won't help
you. If you need all numbers always to be sequential (not
sure why you would) you will need to come up with another
method.

You can also train your users to hit the Escape key twice so
the record is never 'committed' when they back out or handle
it with Me.Undo in code. The number should never be assigned
then.

True against a server IDENTITY, but a Jet AutoNumber is assigned on the
first keystroke and is consumed even if you <Esc> out.
 
Back
Top