Use the Change event of the tab control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
Reply to the newsgroup. (Email address has spurious "_SpamTrap")

"Crystal" <crystal.rouse@sycoleman.com> wrote in message
news:a88301c346f5$579a55d0$a401280a@phx.gbl...
> Hello!
>
> I'm hoping someone can offer some suggestions. I have a
> form with a tab control. The tab control has 5 different
> pages. One of these is Reports. When the user clicks on
> the Reports Tab I need to hide 2 label and 2 text boxes.
>
> I've tried several variations of the below code. Each try
> actually hides the controls BUT when you click on the
> other tabs they are still hidden. How can I get them to
> be visible when clicking to view the other pages on my
> Form?
>
> Private Sub TabCtl38_Click()
>
> Dim bShow As Boolean
>
> bShow = Not (Me.TabCtl38.Value = Me.Reports.PageIndex)
>
> If Me.TabCtl38.Value <> bShow Then
> Me.GFX_ID_Label.Visible = False
> Else
> Me.GFX_ID_Label.Visible = True
> End If
>
> End Sub