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

Changing record source of sub form on report.

Status
Not open for further replies.

TommyDuke

Programmer
Aug 16, 2006
3
0
0
US
Does anyone know how to change the record source on a sub form on a report. I just need to know what event fires when the control (sub form) is loaded on the report. I,ve put breaks in the Current, Open, and Load of the sub form and the report never breaks. It just loads.

Thanks for all the help,
Tommy
 
Not sure about the event order or if it really matters. I generally do this in the Open Event:

Me!subform_name.RecordSource = << insert appropriate source>>
Me!subform_name.Requery

This effectively controls the record source for the specified subform ("subform_name" would obviously be the actual name given to the subform.)

Hope this helps!

 
Apparently you can't change the record source of a sub form on a report. I referenced the form like you said and still I get the ERROR message "Object doesn't support this object or method. If you know anything else please reply, otherwise thanks for the help.
Tommy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top