View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Cameron[_6_] Cameron[_6_] is offline
external usenet poster
 
Posts: 11
Default Controlling Input

Hi all,

Am all most finished my MedEx XLS and found troubles when trying to delete
rows that had a numeric character as the first character (Unsure why).

Regardless, I figured that to ensure some protocol, the first character
could NOT be a numeric character.

The following code works, but it calls the TextBox1_Change() when I attempt
to alter its value. This results in the MsgBox appearing twice.

Any suggestions to solve this apreciated.

TIA
Cameron
-----------------------------------------------------------
Code:
Private Sub TextBox1_Change()
If Len(TextBox1.Text) 0 And IsNumeric(VBA.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
MsgBox "Docors Names generally don't start with numbers.", _
vbOKOnly, "Incorrect Details !!"
TextBox1.Text = ""
TextBox1.SetFocus
ContinueButton.Enabled = False
End If
End Sub
-----------------------------------------------------------