date or number or null

  • Thread starter Thread starter FSt1
  • Start date Start date
F

FSt1

What is a good way to check with code to see if the user
input a number into a text box or a Date or left it blank.
or
if isnull(text box) then
ignore
else
if a number then
do this
else
if a date
do that
end if
end if
end if
 
If IsNull(Me.Text1) = False Then
If IsDate(Me.Text1) Then
' It's a date
ElseIf IsNumeric(Me.Text1) Then
' It's a number
Else
' It's neither a date or a number
End If
End If
 
thatnk you doug. much appreciatied.
-----Original Message-----
If IsNull(Me.Text1) = False Then
If IsDate(Me.Text1) Then
' It's a date
ElseIf IsNumeric(Me.Text1) Then
' It's a number
Else
' It's neither a date or a number
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)






.
 
Back
Top