[AccessD] Autonumber Assigned Immediately

Heenan, Lambert Lambert.Heenan at AIG.com
Thu Sep 8 10:22:35 CDT 2005


Or why he even shows the autonumber value on the form. If the users need to
know what the number is then it has a meaning in addition to its proper use
as a record identifier (Primary Key). So in fact this field with a meaning
to the users (or the real world) should be a separate field in the table,
not an autonumber.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Thursday, September 08, 2005 10:58 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Autonumber Assigned Immediately


I'm interested in knowing why Mike needs the AutoNumber before the record
actually exists?

Susan H. 

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.

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



More information about the AccessD mailing list