Where to Hide Page in Tab Control

S

Steve Haack

I have a Form, which has a tab control on it. When I open the Form, I want to
hide a page in the tab control, based on some other conditions.

During the Form Load event, I check for the condition and then try to hide
the specific page. I get an error that the tab control object is closed or
doesn't exist.

What event would be the appropriate place to put this check and hide the page?

Thanks,
Steve
 
D

Dirk Goldgar

Steve Haack said:
I have a Form, which has a tab control on it. When I open the Form, I want
to
hide a page in the tab control, based on some other conditions.

During the Form Load event, I check for the condition and then try to hide
the specific page. I get an error that the tab control object is closed or
doesn't exist.

What event would be the appropriate place to put this check and hide the
page?


That sounds like a reasonable event to use, if you don't want to do it on a
record-by-record basis. I don't see why you would get the error you report,
so let's have a look at the code you're using.
 
S

Steve Haack

Dirk Goldgar said:
That sounds like a reasonable event to use, if you don't want to do it on a
record-by-record basis. I don't see why you would get the error you report,
so let's have a look at the code you're using.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

I have some code that calls a function to check if the condition that I need
is True, and that part works fine. Then I have this:

Me.tabctlPlayersDetails.Pages("Contact Info").Visible = False
 
S

Steve Haack

I have some code that checks the condition I need and if true, I have this:

Me.tabctlPlayersDetails.Pages("Details").Visible = False
 
D

Dirk Goldgar

Steve Haack said:
I have some code that checks the condition I need and if true, I have this:

Me.tabctlPlayersDetails.Pages("Details").Visible = False


That syntax appears to be correct, so my guess is that the name of the page
is not "Details". Check the properties of the tab page. Maybe "Details" is
the Caption, but the Name is something else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top