Change Query in Sub Form

M

Mike C

Hello,
I have a main form with some combo boxes that I use to filter data in a sub
form. I have added a couple option boxes so that the user can choose which
data set to query in the sub form. I'm not sure how to code it in the on
click event of the option they select. Below is something I thought may have
worked but did not. Any help or suggestions would be greatly appreciated.

sub_form1.Recordset = "QueryName"
 
A

Allen Browne

Set the RecordSource of the form in the subform control:
Me.[sub_form1].Form.RecordSource = "QueryName"

Or, if the query is already set up, you could just requery:
Me.[sub_form1].Form.Requery

If the ".Form" bit doesn't make sense, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top