I'm currently running Access 2007. I have a reporting manager that allows for the user to set parameters. Customize dates and allows for selecting what date field needs to be modified (timecreated, timemodified, txndate). The reporting aspect works perfectly.
Within the report (totalshipped), the user can double click the body of the report and it'll go from "big picture" summary to a detailed report (totalshippeddetailed). Basically in order for it to work properly, the dates from totalshipped and the customer name from the body (on double click) need to match in the totalshippeddetailed report when it opens. Here is an example of what I've tried:
Private Sub ftrReport_DblClick(Cancel As Integer)
DoCmd.OpenReport "TotalShippedDetailed", acViewReport, "", me.filter
End Sub
The report successfully opens up and passes the filter property (dates) onto the totalshipped detailed report, the problem is that I need to reference the [customerref_fullname] (customer) as well which I was doing by using this line:
[reports]![TotalShipped]![customerref_fullname] = [customerref_fullname]
This works as a reference to the customer but I need to combine the me.filter property with the reference to the customerref_fullname, an error occurs when I try:
Private Sub ftrReport_DblClick(Cancel As Integer)
DoCmd.OpenReport "TotalShippedDetailed", acViewReport, "", me.filter & _
[reports]![TotalShipped]![customerref_fullname] = [customerref_fullname]
End Sub
Another way I tried it which works but doesn't allow the detailed version the report to be filtered by anything but the [txndate] :
DoCmd.OpenReport "TotalShippedDetailed", acViewReport, "", _
"[reports]![TotalShipped]![customerref_fullname] = [customerref_fullname] and [txndate] >= [forms]![frmrptdatemanager]![txtstartdate] And [txndate] <= [forms]![frmrptdatemanager]![txtenddate] "
And lastly I took the above code and tried to reference the date field itself in the form which will give an error:
DoCmd.OpenReport "TotalShippedDetailed", acViewReport, "", _
"[reports]![TotalShipped]![customerref_fullname] = [customerref_fullname] and [forms]![frmrptdatemanager]![cboDateField] >= [forms]![frmrptdatemanager]![txtstartdate] And [forms]![frmrptdatemanager]![cboDateField] <= [forms]![frmrptdatemanager]![txtenddate] "
There are many more examples I've tried but none of them can accomplish my goal: allow the users to double click the body of the report to see the detailed report by customer with the same date range as the main report.
Please helP!!!!