DoCmd.GoToRecord , , acNewRec or Me.Recordset.AddNew ?

sjd

Registered User.
Local time
Today, 15:46
Joined
Jun 19, 2012
Messages
34
I am curious if there is any major different between using the the two methods.

DoCmd.GoToRecord , , acNewRec
... set form control values
DoCmd.RunCommand acCmdSaveRecord

OR

Me.Recordset.AddNew
... set recordset values here (not sure of the syntax)
Me.Recordset.Update

In particular, I am looking to have a form have a bulk option button where upon clicking the script:

  • stores the values from a couple fields into variables.
  • asks how many new entries to add
    • creates a new record
    • saves the variables to the fields
    • saves the record
    • continues loop until all entries are created.
  • Returns to entry you started at/copied from to finish editing that entry.
Usually the number of entries will be ~5-25. Do they perform the same? Or is DoCmd slower because you are updating all form controls 10+ times, rather than just updating the underlying database records (if that makes sense).
 
Updating the underlying database records will be quicker.

On a few records I'd do it the most convenient way, may be change it later when you got the time.
 

Users who are viewing this thread

Back
Top Bottom