(re-sending, as my original reply hasn't appeared)
"RJF" <(E-Mail Removed)> wrote in message
news:40D098A8-E9D6-4BAD-A741-(E-Mail Removed)...
>I have a form called frm_ClientConv with 3 tab pages on it. (pg_01, pg_02,
> pg_03)
> There is an unbound control on the form called txt_FilePath.
> I don’t want the txt_FilePath control to be visible when pg_03 is
> selected.
>
> On the Current Event of frm_ClientConv I put the following code:
>
> If [Screen].[ActiveControl].[Name] = "pg_03" Then
>
> txt_FilePath.Visible = False
>
> End If
>
> When I open the form, I get the following error message:
>
> “The expression you entered requires the control to be in the active
> window.”
>
> I’m fairly new to VB so I realize I could be totally off-base with the
> code.
> Any suggestions would be so appreciated.
You can do this by checking the value of the tab control itself. You didn't
give the name of that control, but suppose it is "tabMyTab". Then your code
might be:
Me.txt_FilePath.Visible = (Me.tabMyTab <> Me.pg_03.PageIndex)
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)