Filter by date on form open

mchris

Registered User.
Local time
Today, 10:33
Joined
Sep 12, 2004
Messages
18
Hello All-

I have a form that contains a subform. On the 'on open' event of the subform I have the following code:

Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Failure


Me.Filter = "lngAgentID=" & lngSessionAgentID
Me.FilterOn = True



ExitRoutine:
    Exit Sub

Failure:
    MsgBox Err.Description
    GoTo ExitRoutine
    
End Sub


The subform contains a field called dtmCallDateTime. This field is an autodate/time generated by the system.

I'd like to add an additional filter that will only show the calls that match the current date.

Any suggestions?
 
not sure

I think what I'm trying to do should look something like this.

Code:
Me.Filter = "dtmCallDateTime=" & >= DATE() AND dtmCallDateTime < DATEADD(dd, 1, DATE())
Me.FilterOn = True

But, I can't get this to work???

Any help??
 
Also

Can I have to Me.Filter statement in one event??
 

Users who are viewing this thread

Back
Top Bottom