This might be some help (just off the top of my head, not tested)
- Private Function TestInput() As Boolean
-
If IsNumeric(txtID.Text) and Len(Val(txtID.text) = 9) Then
-
TestInput = True
-
Else
-
MsgBox("Please enter an appropriate FID.", MsgBoxStyle.Exclamation, "Enter FID Properly")
-
txtFID.SetFocus()
-
TestInput = False ' (Not strictly necessary, as False is default)
-
End If
-
End Function
Also note, we may be using different versions of VB - this should work in VB6.
Also, according to the manual, the input for IsNumeric must be a variant, not a string. I haven't checked this.