Open a form with a subform showing specific data

  • Thread starter Thread starter weircolin
  • Start date Start date
W

weircolin

Hi

I have a form called Attendee which has a subform called Attended. I
have a button on another form that open the form "Attended" showing
specific data.

stcombo = cboselectevent

DoCmd.OpenForm "Attended", acFormDS, , "[Event] = " & stcombo

Is there anyway I can get the button to open the form "Attendee" and
get the subform "Attended" to show the data I require?

Thanks

Colin
 
yes, from the command button you can open form "Attendee" and then filter
the subform. something like

DoCmd.OpenForm "Attendee"
With Forms!Attendee!SubformName.Form
.Filter = "Event = " & Me!cboselectevent
.FilterOn = True
End With

you'll have to open form Attendee in Design view, click once on the subform
to select it, then in the Properties box click on the Other tab and look at
the Name property. that's the name of the subform control. use that name to
replace "SubformName" in the code above.

hth
 
Back
Top