Input data, Need help inputing date and correct code.
Input data, Need help inputing date and correct code.
Rate Input data, Need help inputing date and correct code.
(2(2 Vote))
Dim Message(10) As String
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdValidate_Click()
Dim i As Integer
txtDate = Date
End Sub
Message(0) = "Please Enter Date as mm/dd/yy or mm-dd-yy"
Message(1) = "Please Enter SSN as nnnnnnnnn"
Message(2) = "First Name is Required"
Message(3) = "Last Name is Required"
Message(4) = "City is Required"
Message(5) = "State is Required"
Message(6) = "Zip Code is Required"
Message(7) = "All entries correct"
lblMessage = ""
If Not IsDate(txtDate) Then
lblMessage = Message(0)
txtDate.SetFocus
Exit Sub
End If
' check ssn
If txtSSN = "" Or Len(txtSSN) <> 9 Or Not IsNumeric(txtSSN) Then
lblMessage = Message(1)
txtSSN.SetFocus
Exit Sub
End If
' check names
If txtFirstName = "" Then
lblMessage = Message(2)
txtFirstName.SetFocus
Exit Sub
End If
If txtLastName = "" Then
lblMessage = Message(3)
txtLastName.SetFocus
Exit Sub
End If
If txtCity = "" Then
lblMessage = Message(4)
txtCity.SetFocus
Exit Sub
End If
If cboState = "" Then
lblMessage = Message(5)
cboState.SetFocus
Exit Sub
End If
If txtZip = "" Or Not IsNumeric(txtZip) Then
lblMessage = Message(6)
txtZip.SetFocus
Exit Sub
End If
lblMessage = Message(7)
txtDate.SetFocus
End Sub
Input data, Need help inputing date and correct code. Comments
No comments yet — be the first to post one!
Post a Comment