Hi
I'm just about to begin adding some more complex filters into an ADO RS based form (subform actually) and I have an architecture question please.
In the main-form open event, I build an SQL String, apply it to an ADO RS.Open, open the subform with the RS. I then use filters in the main-form Current event (using the new current main-form ID) in order to replicate the Master/Child links functionality in DAO. This works hunky dorey for simple filters.
I started this weeks ago, got distracted and I'm now coming back to it. At that time I'm positive I read somewhere that ADO filters do not have an Operator Preference for ANDs & ORs?? I've looked around but can't find that info again.
Before I start unpicking reams of my code and wandering into the Access maze again I wonder, could I ask please; Firstly, did I imagine this? Secondly, if it is true, how does one achieve the equivalent of the below.
strFilter= "Surname='Smith' AND (FirstName='John' OR FirstName='Fred')
myRS.Filter = adFilterNone
myRS.Filter = strFilter
Set myForm.Recordset = MyForm.Recordset
Thanks
Edit-
Ran a few tests with mixed ANDs & ORs and they seem to produce the correct results... I never trust things I've even seen with my own eyes nowadays.... so any affirmation or contradiction to my results would be much appreciated
I'm just about to begin adding some more complex filters into an ADO RS based form (subform actually) and I have an architecture question please.
In the main-form open event, I build an SQL String, apply it to an ADO RS.Open, open the subform with the RS. I then use filters in the main-form Current event (using the new current main-form ID) in order to replicate the Master/Child links functionality in DAO. This works hunky dorey for simple filters.
I started this weeks ago, got distracted and I'm now coming back to it. At that time I'm positive I read somewhere that ADO filters do not have an Operator Preference for ANDs & ORs?? I've looked around but can't find that info again.
Before I start unpicking reams of my code and wandering into the Access maze again I wonder, could I ask please; Firstly, did I imagine this? Secondly, if it is true, how does one achieve the equivalent of the below.
strFilter= "Surname='Smith' AND (FirstName='John' OR FirstName='Fred')
myRS.Filter = adFilterNone
myRS.Filter = strFilter
Set myForm.Recordset = MyForm.Recordset
Thanks
Edit-
Ran a few tests with mixed ANDs & ORs and they seem to produce the correct results... I never trust things I've even seen with my own eyes nowadays.... so any affirmation or contradiction to my results would be much appreciated

Last edited: