Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control and Enabling....

Status
Not open for further replies.

stlrain95

Programmer
Sep 21, 2001
224
US
I have a 4 Tab Control with everything going into 1 Master Table.

Outside the Tab control I have basic information. When opening the form, if a txt box reads "NO" then I want to NOT enable the first tab...the remainder would be.

Also, when certain fields are filled in the tabs...you can only go to the next tab for data....but can still read the other tabs.

Thank you,
 
Outside the Tab control I have basic information. When opening the form, if a txt box reads "NO" then I want to NOT enable the first tab...the remainder would be. "

Me.MyTabControl.Pages(0).Enabled = False
Me.MyTabControl.Pages(1).Enabled = true
..etc

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thank you for the start...but when I put the code in there...all of them are disabled.

If Text13.Value = "NO" Then
Me.TabCtl0.Pages(0).Enabled = False
ElseIf Text13.Value = "YES" Then
Me.TabCtl0.Pages(0).Enabled = True
End If

What am I doing wrong?
 
Mmm see what you mean

Only work around I can think of is to disable the controls on the tab

eg something like
Dim ctl AS Control

For each ctl in TabCtl.Pages(0)
If Text13.Value = "NO"
ctl.enabled = false
else
ctl.enabled = true
end if
NExt

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
actually, I got this out of it...works great.
Private Sub Form_Current()

' TEST if NO Proof is needed, go straight to START CELL
If Text13.Value = "NO" And Not IsNull(Ship_Date) Then
mod_Complete

ElseIf Not IsNull(Ship_Date) Then
mod_Complete

ElseIf IsNull(Time_In) Then
mod_Start

ElseIf Not IsNull(Time_In) And IsNull(Time_Out) Then
mod_Stop

ElseIf Not IsNull(Time_In) And Not IsNull(Time_Out) And IsNull(Ship_Date) Then
mod_Ship

End If

'Test if A proof is needed then do all this...
If Text13.Value = "YES" And Not IsNull(Ship_Date) Then
mod_Complete

ElseIf Text13.Value = "YES" And IsNull(TxtProofDate) Then
mod_Proof

ElseIf Not IsNull(Ship_Date) Then
mod_Complete

ElseIf Not IsNull(TxtProofDate) And IsNull(Time_In) Then
mod_Start

ElseIf Not IsNull(TxtProofDate) And Not IsNull(Time_In) And IsNull(Time_Out) Then
mod_Stop

ElseIf Not IsNull(TxtProofDate) And Not IsNull(Time_In) And Not IsNull(Time_Out) And IsNull(Ship_Date) Then
mod_Ship

End If

End Sub
 
stlrain95 said:
[blue]I want to NOT enable the first tab...[/blue]
Its possible depending . . .

Could you be a little more definitive/descriptive on what [purple]NOT enable[/purple] would look like to you in this case . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top