Full Version: Using filters on a split form to limit report data.
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
stephenAA5
Hi. I appreciate all the help I can get, as I've gotten things running well, and have completely hit the wall on this one.

I have two tables, Customers and Jobs. There is a JobQuery that combines both for viewing on a split form DispatchForm.

DispatchForm shows the currently highlighted job in great detail at the top of the screen, while having the datasheet view below the rail show various pieces of data upon which a user might filter information. The filtering works fine, now we need output.

I would like to have those filters that are selected be applied to a report, so they can get output. Currently, we go to a report filtering screen, which is not pretty.

I have tried to create a button that essentially has the following procedure:

Private Sub cmdOpenReport_Click()
DoCmd.OpenReport "rptDISPATCH", acViewPreview, , Me.Filter
End Sub

What happens is that the report launches, but I get an error that the query is looking for whatever data the user has selected as a filter. Clearly I'm conceptually wrong.

Thoughts?

Thank you,

Stephen.
Brunn
In the OnOpen event of the report try using this (air code here but its close):

Me.Filter = Forms!Yourform!Reportwhere
Me.FilterOn = True

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.