Problem Setting Tab Control Visible Value

scotthutchings

Registered User.
Local time
Yesterday, 23:57
Joined
Mar 26, 2010
Messages
96
I have a form that when it opens runs the following code in order to hide every control except the required input:
Code:
For Each ctl In Forms![Bid - Bid Proposal]![Bid - Proposal].Controls
            If Not ctl.Name = "cmbReference" And Not ctl.Name = "ReferenceLabel" And Not ctl.Name = "cmdAddReference" And Not ctl.Name = "Box85" Then
                On Error Resume Next
                ctl.Visible = False
            End If
        Next ctl

Once a valid input is received, the desired visible controls are made visible using the following code in the AfterUpdate event:
Code:
     For Each ctl In Forms![Bid - Bid Proposal]![Bid - Proposal].Controls
            If Not ctl.Name = "cmbReference" And Not ctl.Name = "ReferenceLabel" And Not ctl.Name = "ProjectStatus" And Not ctl.Name = "AwardProbability" And Not ctl.Name = "ProposalReference" Then
               On Error Resume Next
               ctl.Visible = True
            End If
        Next ctl

I have a tab control on my form called TabCtl12 with 6 tabs. The first time that I enter the data, this tab control is not visible. It I simply re-enter my data, it then shows up. I need it to show up the first time that valid data is entered. It used to work fine and every other control becomes visible except the tab control. What do I need to do to fix this?

Thanks in advance.
Scott
 
So you make all controls, save a few but including your tab control, invisible when the form opens, and now miss the invisible tab control.

So why do you make the tab control invisible?
 
No need to use code to hide the controls on Open. Set their Visible properties to No in Design View and Save the changes.

The block of code to make it Visible again will fire after you move the cursor to another control.
 

Users who are viewing this thread

Back
Top Bottom