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!

Change record source on a SUB form FROM a MAIN form

Status
Not open for further replies.

bradmaunsell

Programmer
May 8, 2001
156
US
I am having a problem setting the record source for a subform based on an event on the main form.

Main form is "frmAppData" and it has a tab control with 12 tabs. 11 of the tabs have subforms.


I have a button on each subform for setting the record source - this works OK.
I want to eliminate this button on the subform.

I am using an On Change event for the tab control to set the subform record source when the tab is clicked. This is NOT working for setting record source. However, this event works for other "stuff".

For example,
TabControl uses On Change having a SELECT CASE routine

Case "pagNotes"
Forms!frmAppData.frmApp_Notes.SetFocus
Forms!frmAppData.frmApp_Notes.RecordSource = "tblRating_WIP"
Forms!frmAppData.frmApp_Notes.Requery

This TabControl Select Case event fails when running code Forms!frmAppData.frmApp_Notes.RecordSource = "tblRating_WIP"

The error message is "438 Object doesn't support this property or method"



My button on the subform runs OK with

Me.SetFocus
Me.RecordSource = "tblRating_WIP"
Me.Requery

Any help you can offer will be appreciated

Brad
 
Forms!frmAppData.frmApp_Notes[!].Form[/!].RecordSource = "tblRating_WIP"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top