Thanks for the reply. How is the subform tied to the page? -- Thanks for your help! Walter
"Stuart McCall" wrote:
[Quoted Text] > "Walter" <Walter[ at ]discussions.microsoft.com> wrote in message > news:F2E163E0-7467-4EC5-8952-D6FD8AC5D2A8[ at ]microsoft.com... > >I have a form with a tab control which contains several subforms. I would > > like to highlight the pages which contain data. I think I'll have to hide > > any pages on which the subforms are blank. I know I need to test the > > subforms, ie. > > For each subform on mainform > > If IsNull subform1 then > > page0.visible = False > > End If > > Next subform > > How do I reference these from the main form? > > -- > > Thanks for your help! > > Walter > > Although the subforms are on different pages of a tab control, they are > members of the form's controls collection, so the syntax is: > > For Each ctl In Me.Controls > If TypeOf ctl Is Subform Then > If IsNull(ctl.Form!ControlName) Then > Me.TabControlName.Page(n).Visible = False > End If > End If > Next > > Untested, but that ought to be somewhere close.. > > >
|