[AccessD] Autonumber Assigned Immediately

Charlotte Foust cfoust at infostatsystems.com
Thu Sep 8 10:31:11 CDT 2005


That doesn't make sense.  If you have pull data in from other tables and
populated fields in a new record, the autonumber should have been
assigned, so there's something you aren't telling us.  And as someone
else pointed out, the user should NEVER see the autonumber.  It has no
meaning, it merely identifies a row, not the data in the row, and it
should not be treated as meaningful.

Charlotte Foust


-----Original Message-----
From: Gowey Mike W [mailto:Mike.W.Gowey at doc.state.or.us] 
Sent: Thursday, September 08, 2005 8:20 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Autonumber Assigned Immediately


I know it sounded weird, but technically the record did already exsist,
the user makes the decision to go ahead and create the record and I pull
info from other tables and information that they selected from a prior
form and bring it over to the Invoice screen. All the needed fields were
automatically filled in for the user, I was just not getting the number
assigned so that the user can see it. So the On Current that Andy
suggested works like a charm.

I hope I made sense with that  :-)

Thanks again Andy


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

-----Original Message-----
From: Susan Harkins [mailto:ssharkins at bellsouth.net] 
Sent: Thursday, September 08, 2005 8: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


-- 
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