G
Guest
Hi,
I have a customer form on which I have a button to open a report. When I
open a report, I would like to apply a filter to the report, so that it shows
only the data for the customer being viewed in the form.
Here is the code that Access generated.
Dim stDocName As String
stDocName = "Portfolio Profitability Report"
DoCmd.OpenReport stDocName, acPreview
And this is what I added trying to apply a filter.
stDocName.Filter = "customer_id = Me.id"
st.DocName.FilterOn = True
Obviously, it doesn't work and I was hoping someone could show me how to do
it.
Many thanks.
I have a customer form on which I have a button to open a report. When I
open a report, I would like to apply a filter to the report, so that it shows
only the data for the customer being viewed in the form.
Here is the code that Access generated.
Dim stDocName As String
stDocName = "Portfolio Profitability Report"
DoCmd.OpenReport stDocName, acPreview
And this is what I added trying to apply a filter.
stDocName.Filter = "customer_id = Me.id"
st.DocName.FilterOn = True
Obviously, it doesn't work and I was hoping someone could show me how to do
it.
Many thanks.