[AccessD] Autonumber Assigned Immediately

Gowey Mike W Mike.W.Gowey at doc.state.or.us
Thu Sep 8 10:19:52 CDT 2005


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





More information about the AccessD mailing list