D
dch3
I'm thinking that I already understand why, but Im curious if I'm on target...
I'm using the following line to explicity add a new record to the recordset
of a subform.
[Forms]![frmTrailerActivityUnloadsWizard]![subfrmTrailerActivityUnloadsDetail].Form.Recordset.AddNew
What I've noticed is that the Autonumber skips so instead of going from 846
to 847 it goes to 848. I'm assuming that the specific reason is tied to the
fact that when you actually add a new record and Access assigns a new
Autonumber that Access actually executes the equivalent of .AddNew itself.
Hence when you're in table view, you see a new row appear with (AUTO NUMBER)
in the field. By explicity adding a new one, I'm causing Access to skip over
the record that it anticipates adding itself.
MVPS - The code is a part of a wizard and I needed the ability to
automatically add a new record without relaying on the user to tab through
the fields and then to a new record. Toss in there that its a new record on a
subform and I couldn't figure out how to use DoCmd.Goto on a subform.
I'm using the following line to explicity add a new record to the recordset
of a subform.
[Forms]![frmTrailerActivityUnloadsWizard]![subfrmTrailerActivityUnloadsDetail].Form.Recordset.AddNew
What I've noticed is that the Autonumber skips so instead of going from 846
to 847 it goes to 848. I'm assuming that the specific reason is tied to the
fact that when you actually add a new record and Access assigns a new
Autonumber that Access actually executes the equivalent of .AddNew itself.
Hence when you're in table view, you see a new row appear with (AUTO NUMBER)
in the field. By explicity adding a new one, I'm causing Access to skip over
the record that it anticipates adding itself.
MVPS - The code is a part of a wizard and I needed the ability to
automatically add a new record without relaying on the user to tab through
the fields and then to a new record. Toss in there that its a new record on a
subform and I couldn't figure out how to use DoCmd.Goto on a subform.