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
 

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

Similar Threads

Convert Julian to Date 1
Month problem 4
Workbook reminder 0
Setting BaselineSavedDate 0
Making a macro only work on certain files 2
Printing issue 1
datepart function 3
Countdown macro - display settings 2

Top