[RESOLVED] Disable switching tabs.
I have an SSTab control on my form with several tabs. I would like to disable the switching of tabs while a certain condition is true.
I have tried several things, none of which work correctly.
This worked fine on my laptop:
Code:
Private Sub tabMainForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If editMode > 0 Then
MsgBox "Please finish entering information. Click Save or Cancel."
End If
'End Sub
But not on my PC, which I thought was strange.
Any ideas?
Re: Disable switching tabs.
Try something like this instead:
Code:
Option Explicit
Dim editMode As Boolean
Private Sub Form_Load()
SSTab1.Tab = 1
End Sub
Private Sub Command1_Click()
editMode = Not editMode
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Static currentTab As Integer
If editMode Then
SSTab1.Tab = currentTab
Else
currentTab = SSTab1.Tab
End If
End Sub
Re: Disable switching tabs.
Hi, sorry for the delay. That worked a treat, thanks a lot.