Problem with date code

sandylt

Registered User.
Local time
Yesterday, 19:16
Joined
Mar 11, 2004
Messages
36
I am using the following code to make the duedate field on my report invisible if it is greater than firstofmonth field. Can someone tell me what I am doing wrong?

Private Sub Report_Open(Cancel As Integer)
If Me.[FirstOfMonth] >= "Date()" Then
Me.[DueDate].Visible = True
Else
Me.[DueDate].Visible = False
End If
End Sub
 
Private Sub Report_Open(Cancel As Integer)
If Me.[FirstOfMonth] >= Date() Then
Me.[DueDate].Visible = True
Else
Me.[DueDate].Visible = False
End If
End Sub


???
ken
 
Hope this helps

Try putting your code onto the on page event:

Private Sub Report_Page()
If Me.FromDate >= "Date()" Then
Me.FromDate.Visible = True
Else
Me.FromDate.Visible = False
End If
End Sub

I just tried it on one of my reports and I got no errors.
 

Users who are viewing this thread

Back
Top Bottom