Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Subform Data by main form CombolBox

Status
Not open for further replies.

SwingXH

Technical User
Jun 15, 2004
97
US
I would like to put a subform on a main form to show the records. And the records on the subform should be controled by a comboBox on the main form,values of which the user can change.

I knew how to display the records on a separate form. The codes look like
DoCmd.OpenForm "FormName",,,"FieldName=" &Me ("ComboName").Value

But how to make the similar function but on a subform?
Thanks a lot!
SwingXH
 
Make the recordsource of your subform point to a query. This query will extract the required details with the criteria you indicated:

FieldName=Forms!YourFormName!ComboName






 
how to make the similar function but on a subform
Playing with the subform's RecordSource property and Requery method in the AfterUpdate event procedure of the combo.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you very much to SarahG!
Many thanks to PHV for helping me on many questions!

SwingXH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top