Date() causes error 438 (1 Viewer)

Jim8541

Registered User.
Local time
Today, 15:50
Joined
Aug 13, 2004
Messages
14
:confused: Hello, I'm receiving error 438 "Does not support this property or method when I try to set my Today variable = Date().
Here's my sub
Code:
Public Sub GetDaysWorking(StartDate As Date, TermDate As Date)
Dim Start As Date
Dim Term As Date
Dim DaysWorking As Integer
Dim Today As Date

Today = DATE


    If StartDate = "12:00:00 AM" Then
        StartDate = 0
    Else
    Start = Nz(StartDate, 0)
    Term = Nz(TermDate, 0)
    End If
   If Start > Term Then
    Term = Today
    Else
    Term = Term
    End If
    

'Call to function Business Days
DaysWorking = BusinessDays(Start, Term)
Forms!frmMain!frmSubTab!txtDaysWorking = DaysWorking

End Sub
Any ideas why I can't set Today equal to today's date using Date()?
Thanks Jim
 
Do you have a form field called Date as this will confuse Access, otherwise the code appears OK.
 
Thanks for the reply. I tried using a different name, Holder as date, but it didn't work. I'm going thru the forms looking for a field named date. When I tried using Now it worked fine. There must be something called date in there somewhere.
Jim
 
I suspect you have a missing reference, try searching the archives here for a solution
 
Rich said:
Today already returns todays date, try another name
rich,

Today is an excel function, this should not bother Access...

Greetz
 
namliam said:
rich,

Today is an excel function, this should not bother Access...

Greetz
True, and it isn't listed as a reserved word, but it does work in Access
 

Users who are viewing this thread

Back
Top Bottom