Changing Form RecordSource and then Requery

Gasman

Enthusiastic Amateur
Local time
Today, 06:48
Joined
Sep 21, 2011
Messages
16,602
I have seen a few posts recently whereby members are changing recordsource and then issuing a Me.Requery after it.

As I have mentioned in those threads, I was under the impression that just changing the recordsource is in effect a requery in itself.

I have just tried to test this is a test form and got the following.

Am I wrong in this regard? The debug seems to indicate not? Whilst a few records in table/query is not going to make much difference I know, I would expect with large datasets it is inefficient?

Source is tblDates for the form in it's properties. I just changed the order as the test.

1703946036781.png
 
Am I wrong in this regard?
No, you are right.

The .Requery is totally unnecessary in this instance.

People do it because they don't really understand what's happening in the code.

With modern PC's and in most instances of underlying recordset size, it is probably un-noticeable though!
 
It even states this explicitly in a note in the docs

Note

Changing the record source of an open form or report causes an automatic requery of the underlying data. If a form's Recordset property is set at runtime, the form's RecordSource property is updated.
 

Users who are viewing this thread

Back
Top Bottom