arale
Jun 25th, 2000, 06:52 AM
i want the user to insert a date in a text box , amd i dont
want him to insert a number like - 1111111 and i dont want him to insert a string like - aaaaaaaaa so ,
i want him to insert a date of birth in the format of "dd/mm/yy" so i wrote :::
Private Sub txtdateofbirth_LostFocus()
Dim number As Long
Dim word As String
If txtdateofbirth.Text = number Then
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
ElseIf txtdateofbirth.Text = word Then
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
Else
If Format(txtdateofbirth, "dd/mm/yy") = txtdateofbirth.Text Then
Exit Sub
Else
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
txtdateofbirth.Text = ""
txtdateofbirth.SetFocus
Exit Sub
End If
End If
txtdateofbirth = Format(txtdateofbirth, "dd/mm/yy")
End Sub
whats wrong in it ?????????????????
please help and thank you in advance
amit
[Edited by arale on 06-26-2000 at 06:46 AM]
want him to insert a number like - 1111111 and i dont want him to insert a string like - aaaaaaaaa so ,
i want him to insert a date of birth in the format of "dd/mm/yy" so i wrote :::
Private Sub txtdateofbirth_LostFocus()
Dim number As Long
Dim word As String
If txtdateofbirth.Text = number Then
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
ElseIf txtdateofbirth.Text = word Then
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
Else
If Format(txtdateofbirth, "dd/mm/yy") = txtdateofbirth.Text Then
Exit Sub
Else
MsgBox "אנא הכנס תאריך חוקי", , "תאריך לא חוקי"
txtdateofbirth.Text = ""
txtdateofbirth.SetFocus
Exit Sub
End If
End If
txtdateofbirth = Format(txtdateofbirth, "dd/mm/yy")
End Sub
whats wrong in it ?????????????????
please help and thank you in advance
amit
[Edited by arale on 06-26-2000 at 06:46 AM]