I'm now failing to understand this requery property, see the definition below:
Me.Requery forces the entire recordset (underlying data) for the form to reload. This means ALL of the records in your current form will reload. Your current position will be lost, so if you're sitting on record 10 of 100, you'll find yourself back on the first record. Me.Requery is essentially the same as closing and reopening the form. Any new records added by other concurrent users will be available. Likewise any records that have been deleted will disappear. Requery essentially "re-runs the query" that pulled the data into the form in the first place. You can also use requery to update the data in a list box or combo box.
As per above definition is there a difference with the below combination:
Private Sub Refresh_Click()
DoCmd.Save
DoCmd.Close
DoCmd.Opern Form "XXXXXX"
End Sub
Sure, there is a difference. Cause one of your assumptions is wrong:
Me.Requery is essentially the same as closing and reopening the form
Closing and reopening can lose more information than a Requery. E.g. form level variables or filters.
And much more: a requery does only raise one event (On Current), whereas closing and reopening would raise a whole bunch of them. Where each event may have effects.
Closing and reopening can lose more information than a Requery. E.g. form level variables or filters.
And much more: a requery does only raise one event (On Current), whereas closing and reopening would raise a whole bunch of them. Where each event may have effects.