Integer) a = KeyAscii If (Not a < 8) And (Not a > 127) Then MsgBox "Can't write ", vbCritical KeyAscii = 0 Exit Sub End If End Sub
Private Sub combo_dname_keypress(KeyAscii As
Integer) a = KeyAscii If (Not a < 8) And (Not a > 127) Then MsgBox "Can't write ", vbCritical KeyAscii = 0 Exit Sub End If End Sub
Private Sub combo_sname_keypress(KeyAscii As
Integer) a = KeyAscii If (Not a < 8) And (Not a > 127) Then MsgBox "Can't write ", vbCritical KeyAscii = 0 Exit Sub End If End Sub
Private Function validate() As Boolean
If Trim(txt_name.Text) = "" Then MsgBox "enter the name", vbCritical txt_name.SetFocus validate = False Exit Function End If If Trim(txt_address.Text) = "" Then MsgBox "enter the address", vbCritical txt_address.SetFocus validate = False Exit Function End If
If Trim(txt_phno.Text) = "" Then
MsgBox "enter the phone number", vbCritical txt_phno.SetFocus validate = False Exit Function End If
If Trim(txt_phno.Text) = "" Or Len(txt_phno.Text) <> 10
Then MsgBox "It is not a valid contact number.... Enter the valid Contact number with 10 digit!", vbCritical txt_phno.SetFocus validation = False Exit Function End If
If Trim(txt_place.Text) = "" Then
MsgBox "enter the place", vbCritical txt_place.SetFocus validate = False Exit Function End If
If Trim(txt_pin.Text) = "" Then
MsgBox "enter the pin", vbCritical txt_pin.SetFocus validate = False Exit Function End If
If Trim(txt_pin.Text) = "" Or Len(txt_pin.Text) <> 6 Then
MsgBox "It is not a valid pin number.... Enter the valid pin number with 6 digit!", vbCritical txt_pin.SetFocus validation = False Exit Function End If
If Trim(txt_status.Text) = "" Then
MsgBox "click on status", vbCritical txt_status.SetFocus validate = False Exit Function End If
If Trim(Combo_sname.Text) = "..select.." Then
MsgBox "select the section name", vbCritical Combo_sname.SetFocus validate = False Exit Function End If
If Trim(combo_dname.Text) = "..select.." Then
MsgBox "select the division name", vbCritical combo_dname.SetFocus validate = False Exit Function End If
If Trim(combo_aname.Text) = "..select.." Then
MsgBox "select the area name", vbCritical combo_aname.SetFocus validate = False Exit Function End If validate = True End Function
Private Sub txt_phno_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) = False And Not KeyAscii = 8 Then MsgBox "Only Numbers are allowed", vbCritical KeyAscii = 0 End If End Sub
Private Sub txt_pin_keypress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) = False And Not KeyAscii = 8 Then MsgBox "Only Numbers are allowed", vbCritical KeyAscii = 0 End If End Sub Private Sub txt_name_keypress(KeyAscii As Integer) a = KeyAscii If ((Not a = 8) And (Not a = 127) And (Not a = 32)) Then
If a < 65 Then MsgBox "Enter a valid name", vbCritical KeyAscii = 0 Exit Sub End If
If a > 57 And a < 65 Then
MsgBox "Enter a valid name", vbCritical KeyAscii = 0 Exit Sub End If
If (a > 90 And a < 97) Then
MsgBox "Enter a valid name", vbCritical KeyAscii = 0 Exit Sub End If
If (a > 122) Then
MsgBox "Enter a valid name", vbCritical KeyAscii = 0 Exit Sub End If