Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: conditional format tab control pages

Geek News

conditional format tab control pages
Walter 12/11/2008 8:30:00 PM
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
Re: conditional format tab control pages
"Stuart McCall" <smccall[ at ]myunrealbox.com> 12/12/2008 1:34:16 AM
"Walter" <Walter[ at ]discussions.microsoft.com> wrote in message
news:F2E163E0-7467-4EC5-8952-D6FD8AC5D2A8[ at ]microsoft.com...
[Quoted Text]
>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..


Re: conditional format tab control pages
Walter 12/15/2008 2:44:15 PM
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..
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net