I am taking the results of that information and have a button where my end-user can click on it and it takes them to a report with a subform pivot graph in my footer/or header.
My problem is, my subform pivot graph does not update with my GetFilterFromListBox results.
so I assume your report is opened with some code like this
Code:
Dim strWhere As String
strWhere = GetFilterFromListBoxes
DoCmd.OpenReport "yourReportName", acViewPreview, , strWhere
So that the recordsource of the report is limited by the filter.
It sounds like that is working.
My guess is that the graph is not showing child records but summarizing data for the records in the report. So you probably do not have (or need) a link master, link child relationshp. So the trick is to have the graph use the same filter as the main report. Now it is probably based on the main table. Unfortunately you cannot (AFAIK) provide a simple filter to the graph, because the graph is usually based on a crosstab query.
I think I would do it as follows.
1) Create a query definition. Lets call it qryFilteredReport
3) Build your graph and use the "qryFilteredReport" as part of the recordsource
Maybe something like
"TRANSFORM Count(*) AS [Count] SELECT qryFilteredReport.CONDITION_CATEGORY FROM qryFilteredReport GROUP BY qryFilteredReport.CONDITION_CATEGORY PIVOT qryFilteredReport.MTH;
All I am demonstrating is that you will use "qryFilteredReport" as the recordsource. Your query is likely very different.
4) Base the report on qryFilteredReport as well.
5) Now what has to be done is to modify the actual sql of qryFilteredReport.
The code would be something like this before you call the report
Code:
dim qdf as dao.querydef
dim strSql as string
Dim strWhere As String
strWhere = GetFilterFromListBoxes
set qdf = currentdb.querydefs("qryFilterdReport")
strsql = "Select * qualQ1 WHERE " & strWhere & " ORDER BY...."
qdf.sql = strWhere
So what this does is changes the sql of the query that the report and the graph are based.
I used qualQ1 as the soure, but you need to start with a query that has whatever fields and tables you need.
If you want to post again, I can take a look.