filter report by dates

samjesse

Registered User.
Local time
Today, 07:39
Joined
Feb 13, 2009
Messages
64
Hello

I have a command button on a form which fires a report, the report gets its data from a query.
I need to filter that report by limiting the data to show only those records between two dates which are on the form.

I was able to a bit of that in VBA, so now when I fire the report it just opens the report but it does not apply the filter.
in the filter section in the report properties it shows
(01/01/1999 AND 30/01/1999)

here is the event
Private Sub cmdTransItems_Click()
...
crit = [Forms]![frmChooseDates].[Form]![StartDate] & " AND " & [Forms]![frmChooseDates].[Form]![EndDate]
...
DoCmd.OpenReport "rptTransGroups", acViewPreview, , crit
...

something is wrong in the crit which is not letting the filter work correctly.

please help
thanks
 

Users who are viewing this thread

Back
Top Bottom