View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Controlling Input

You have to set a flag that controls your code. For example:


Dim Working as Boolean

Private Sub TextBox1_Change()
If Not Working Then
If Len(TextBox1.Text) 0 And IsNumeric(Left(TextBox1.Text, 1)) = False
Then
If Len(TextBox2.Text) 0 Then
If Len(TextBox3.Text) 0 Then
ContinueButton.Enabled = True
Else
ContinueButton.Enabled = False
End If
Else
ContinueButton.Enabled = False
End If
Else
Working = True
MsgBox "Docors Names generally don't start with numbers.", _
vbOKOnly, "Incorrect Details !!"
TextBox1.Text = ""
TextBox1.SetFocus
ContinueButton.Enabled = False
Working = False
End If
End If
End Sub


--
Jim Rech
Excel MVP