[AccessD] Autonumber Assigned Immediately

Andy Lacey andy at minstersystems.co.uk
Thu Sep 8 09:42:07 CDT 2005


Hi Mike
As you've found out the autonumber only gets allocated when you begin to
populate a record. Anything you do to override that is potentially going to
give you problems when the user wants to cancel the creation of a record
because the autonumber will still get used up. It also means in a multi-user
situation that the next number will be got as you enter the screen not as
you write the final record. But if that's not an issue for you, or you're
prepared to deal with that then you could, for example, create a field on
your table, leave it off the form then (or make it hidden) then in the
OnCurrent have:

If Me.NewRecord then
me!fldDummy=1        'or whatever
End if

By forcing something into the record the autonumber will be got.

But, as I say, make sure you've thought the implications through.

--
Andy Lacey
http://www.minstersystems.co.uk




--------- Original Message --------
From: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Subject: [AccessD] Autonumber Assigned Immediately
Date: 08/09/05 14:13



Could someone explain to me how to get a autonumber assigned to a record
as soon as the form is opened for data input. Right now when I open the
form it will not show me or assign an autonumber until I enter data in
the first field. I want the number to be assigned and shown when the
form opens.

TIA for any help provided.


Mike Gowey MCDST, A+, LME, NET+
Team Leader - East Region
Information Systems Unit

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

________________________________________________
Message sent using UebiMiau 2.7.2




More information about the AccessD mailing list