subform record source update

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

Form1 has an option group with 6 options and a subform which uses select
case (based upon the option group in form1) in the load event to select a
separate query as the record source.

However, when I select a different option in Form1's option group, subform2
doesnt update accordingly. I've tried docmd.refresh, docmd.requery, etc.
but nothng works.

I'm beginning to think it is impossible, but you guys do the impossible all
the time. Any suggestions?

TIA

Craig
 
craig said:
Form1 has an option group with 6 options and a subform which uses select
case (based upon the option group in form1) in the load event to select a
separate query as the record source.

However, when I select a different option in Form1's option group, subform2
doesnt update accordingly. I've tried docmd.refresh, docmd.requery, etc.
but nothng works.


Setting a form's RecordSource is pretty simple. For the
main form to set the subforms revord source:

Me.subformcontrol.Form.RecordSource = "query1"

For the subform to set the main form's:

Parent.RecordSource = "query1"

For eithr form to set it's own record source:

Me.RecordSource = "query1"
 
Bingo! Thanks Marshall!

Marshall Barton said:
Setting a form's RecordSource is pretty simple. For the
main form to set the subforms revord source:

Me.subformcontrol.Form.RecordSource = "query1"

For the subform to set the main form's:

Parent.RecordSource = "query1"

For eithr form to set it's own record source:

Me.RecordSource = "query1"
 

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

Back
Top