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

Sub Form RecordSource 1

Status
Not open for further replies.

LarryDeLaruelle

Technical User
May 19, 2000
1,055
US
Is it possible to change a subform's recordsource from the main form? Based on user choices, I want to change the query behind the sub form or, alternatively, use and sql string in record source. I've tried:

frmSubForm.recordsource =
or
me.formSubForm.recordsource =

both produce an error that says the property is not recognized.

Thanks in advance

Larry De Laruelle

 
This is perfectly possible. You must remember that a subform consist of a subform control and the form contained. It is the recordsource of the contained form that you wish to change so:

Me.[Name Os Subform Control].Form.RecordSource = "SELECT * FROM table"


 
Remou:

Thanks for the reply and the code.

Works like a champ. I guess I was on the right track, just did not have the syntax correct.

Thanks again.

Larry De Laruelle

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top