RE: Required Field for 7 Numeric digits only
- From: Malik <software_guru@xxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 09:26:00 -0700
Hi,
Private Sub TextBox1_LostFocus()
Dim IsValid As Boolean
IsValid = True
' Checking if TextBox value is 7 digits and all the contents are numeric
or not
IsValid = ((Len(TextBox1.Text) = 7) And IsNumeric(TextBox1.Text))
If IsValid = False Then
MsgBox "Please enter 7 numeric digits only...", vbCritical + vbOKOnly
End If
End Sub
You can improve this by adding this routine at any proper place in your code
--
Malik
"LRay67" wrote:
I have a required field that can contain only 7 numeric digits within the.
textbox. Also want to put in a message box to alert them that this field
must have 7 numeric digits. Any suggestions on how to write the code behind
this? Thanks
Linda
- Follow-Ups:
- RE: Required Field for 7 Numeric digits only
- From: LRay67
- RE: Required Field for 7 Numeric digits only
- From: LRay67
- RE: Required Field for 7 Numeric digits only
- References:
- Required Field for 7 Numeric digits only
- From: LRay67
- Required Field for 7 Numeric digits only
- Prev by Date: RE: Button tips
- Next by Date: RE: Re-starting a project but avoiding recursion???
- Previous by thread: Required Field for 7 Numeric digits only
- Next by thread: RE: Required Field for 7 Numeric digits only
- Index(es):
Loading