It depends on how the form is opened. Test scenario see #13.The first query would select potentially thousands of rows but the second selects only 1.
Once it is open, it does not matter whether you select the data records with a changed RecordSource or Filter property. Both variants generate the same retrieval in the SQL server.
Example:
Open form with id = 4, later (e.g. after user action) change to id = 12
a) Form with Recordsource stored query (incl. where):
1. update query:
select ... from Table where id = 4
2.
doCmd.OpenForm "xyz"
change to id=12
3. update query (or recordsource property):
select ... from Table where id = 12
b) Form with recordsource:
select ... from Table
(without where)1.
docmd.OpenForm "xyz", , , "id = 4"
(WhereCondition parameter sets the Filter property)change to id =12
2.
Me.filter = "id = 12"
Last edited: