autonumber and subform problem

dbertanjoli

Registered User.
Local time
Today, 18:56
Joined
Sep 22, 2000
Messages
102
Dear all,

I would like my outnumber field to be populated on open event. This is because I have a subform on my main form and if someone starts entering data in sub form first then after that entering data on main form, after saving this record data on my sub form won’t be saved because the auto number is assign only after data is entered on my main form first not on my subform.

Can anyone please help me with this problem.

Debbie
 
That is the way the autonumber works. It will be assinged as soon as data is entered on the record. You could create VBA sub to assing a key. something like below would work

Dmax("PKField',"tablenAME")+1

This would increment the pk field by 1 number.
 
Hello,
Thank you for your reply. I just tested it and it doesn't work. How can I ensure that someone first enter last name (to assign autonumber) before it moves to subform?

Deb
 
Keith,
It is still not working. Is there a way to have autonumber on main form filled in on open?
Deb
 
Maybe try adding some code to populate a field and then another line to change the field to a zero lenght string. This way the autonumber will probably populate. Something like below

me.textbox="something"
me.textbox=""
 

Users who are viewing this thread

Back
Top Bottom