BigHappyDaddy
Coding Monkey Wanna-Be
- Local time
- Today, 13:13
- Joined
- Aug 22, 2012
- Messages
- 205
I have a question concerning the pros and cons of setting a form's recordsource using a dynamic SQL statement versus setting the form's filter property.
My friend's project has a form with multiple sub-forms and within those sub-forms, some have more subforms. He has starting running into performance issues. He asked me to take a look and the main form is based on a query, then in code he is appying a filter using the form's filter property. The query he has built does not do any filtering at all. Just links various tables together.
I am assuming that he is using the filter approach on all his subforms.
My question: Would he be better off by setting the form's recordsource to an SQL statement that could be dynamically written to 'prefilter' the data before it is loaded to the form? Then take the same approach on all the subforms?
My thought is by using the filter, the form has to load all the records first, then filter the records. Where setting the recordsource would only return the records he is interested in seeing.
Neither one of us are professional developers, just a couple of guys that like trying to fulfill that role in our current situations. Any thoughts would be very much appreciated.
My friend's project has a form with multiple sub-forms and within those sub-forms, some have more subforms. He has starting running into performance issues. He asked me to take a look and the main form is based on a query, then in code he is appying a filter using the form's filter property. The query he has built does not do any filtering at all. Just links various tables together.
I am assuming that he is using the filter approach on all his subforms.
My question: Would he be better off by setting the form's recordsource to an SQL statement that could be dynamically written to 'prefilter' the data before it is loaded to the form? Then take the same approach on all the subforms?
My thought is by using the filter, the form has to load all the records first, then filter the records. Where setting the recordsource would only return the records he is interested in seeing.
Neither one of us are professional developers, just a couple of guys that like trying to fulfill that role in our current situations. Any thoughts would be very much appreciated.