Swap queries to display diferent filtered records in subform

D

Don

I am trying to use predefined queries as subform data and swap the assigned
query names for the subform data, This swap of queries will be based on
option group radio buttons to filter subform data using the correct query. I
tried other ways that did not work and I think this may be a viable way to
accomplish this task. So my question is how can I use various queries to
filter subform data that cannot be filtered based on main form data.
 
D

Duane Hookom

You can use the After Update event of your option group radio buttons with
Select Case statements like:

Dim strRecordSource as String
Select Case Me.OptGroup
Case 1
strRecordSource = "qselOne"
Case 2
strRecordSource = "qselTwo"
Case 3
strRecordSource = "qselThree"
End Select
Me.sfrmCntrl.Form.RecordSource = strRecordSource
 
D

Don

Duane,

Great suggestion it works well!!
--
Thanks,

Dennis


Duane Hookom said:
You can use the After Update event of your option group radio buttons with
Select Case statements like:

Dim strRecordSource as String
Select Case Me.OptGroup
Case 1
strRecordSource = "qselOne"
Case 2
strRecordSource = "qselTwo"
Case 3
strRecordSource = "qselThree"
End Select
Me.sfrmCntrl.Form.RecordSource = strRecordSource
 
Top