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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Recordsource

Status
Not open for further replies.

Sech

Programmer
Jul 5, 2002
137
GB
I am currently creating a form that uses a subform to display different sets of results, each using a different query (with the same field names). What code can I use to update the rowsource of the subform e.g. When an item is selected from a combo box?

I have tried Forms!subData.Rowsource = "qryDataSet1"
This give the error "Can't find the form 'subData'".

I have also tried Forms!frmResults.subData.Rowsource = "qryDataSet1" which does not work either

Does anyone know the correct line of code to use or if I have to set up any additional variables?
 
In the After Update event of your combo if on a Main Form:

Me!subData.Form.Rowsource = "qryDataSet1"

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top