Date Is Null

J

Jasper

My Date is null. Why might that be:

Private Sub Command3_Click()
Dim MyDate
MyDate = Date
MsgBox (MyDate)
End Sub
 
W

Wayne Morgan

I just tried this and it works. Do you have any items that you have called
"Date"? Date is a reserved word and should only be used as you have it here.
If you have a field or control called Date, you may be getting the value of
the field or control instead.

Also, if MyDate is supposed to be a date and you don't need it to be a
Variant, then it should be

Dim MyDate As Date
 
Top