enabling a tab

B

bfence

Hi! I have a parent form (TC_Char) with a subform (Cand). On Cand I
have a tab control with a subform (ST) I'd like to enable ONLY when
the CandDecision field says "Admitted". Is there a way to do this?
Each Candidate can have more than one Cand record - it depends on the
status of their applications.

Thanks in advance for the help!
Betsy
 
B

Beetle

You can do the following;

Me.tbYourTabControl.Pages(x).Enabled = False

where x = the Page Index of the tab in question. This will not prevent users
from selecting/viewing the tab, but it will prevent them from entering/editing
anything on the tab. If you don't want them to even be able to select the tab
then use;

Me.tbYourTabControl.Pages(x).Visible = False

Now, without knowing more about your form setup, it's hard to tell you exactly
how to code it, but if the CandDecision control is on the same form as the
tab control then you might try something like this in the Current event of
that form;

Me.tbYourTabControl.Pages(x).Enabled = Me.CandDecision = "Admitted"
 
B

bfence

You can do the following;

Me.tbYourTabControl.Pages(x).Enabled = False

where x = the Page Index of the tab in question. This will not prevent users
from selecting/viewing the tab, but it will prevent them from entering/editing
anything on the tab. If you don't want them to even be able to select thetab
then use;

Me.tbYourTabControl.Pages(x).Visible = False

Now, without knowing more about your form setup, it's hard to tell you exactly
how to code it, but if the CandDecision control is on the same form as the
tab control then you might try something like this in the Current event of
that form;

Me.tbYourTabControl.Pages(x).Enabled = Me.CandDecision = "Admitted"

Thanks Sean! I'll give this a try.

Betsy
 

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