Open a form with a subform showing specific data

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
 
T

tina

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
 

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