date or number or null

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
 
D

Douglas J. Steele

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
 
F

Fst1

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!)






.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top