Tell us about the Row Source of your chart control. Does it have a reference
to a control on a form? Is the Row Source a crosstab query? Have you set any
Query->Parameters in your source?

Signature
Duane Hookom
Microsoft Access MVP
The Chart Row Source statement is:
TRANSFORM Sum([qryStrongly Agree Chart].[Count Of Survey]) AS [SumOfCount Of
Survey]
SELECT [qryStrongly Agree Chart].QACode AS Expr1
FROM [qryStrongly Agree Chart]
GROUP BY [qryStrongly Agree Chart].QACode
PIVOT [qryStrongly Agree Chart].YrQtr;
The Row Source of the chart was created by the report/chart creation wizard.
All references to the controls on the form are in the stored query
(qryStrongly Agree Chart) which is collecting and summarizing the data. One
of those controls is a MultiList box, the other is a combobox control.
The statement for the stored query is:
SELECT DISTINCTROW
Year(Survey.SurveyDate)*4+DatePart('q',Survey.SurveyDate)-1 AS Expr1,
TargetAreas.TargetParent, TargetAreas.TargetDesc, [SurveyYear] & "Q" &
[SurveyQuarter] AS YrQtr, "Q" & CStr([QuestCode]) & "A" & CStr([AnswerCode])
AS QACode, Format$(Survey.SurveyDate,'\Qq yyyy') AS [SurveyDate By Quarter],
Survey.SurveyArea, Survey.SurveyQuarter, Survey.SurveyYear, Survey.QuestCode,
Survey.AnswerCode, Count(*) AS [Count Of Survey]
FROM TargetAreas INNER JOIN Survey ON TargetAreas.TargetNo = Survey.SurveyArea
GROUP BY Year(Survey.SurveyDate)*4+DatePart('q',Survey.SurveyDate)-1,
TargetAreas.TargetParent, TargetAreas.TargetDesc, [SurveyYear] & "Q" &
[SurveyQuarter], "Q" & CStr([QuestCode]) & "A" & CStr([AnswerCode]),
Format$(Survey.SurveyDate,'\Qq yyyy'), Survey.SurveyArea,
Survey.SurveyQuarter, Survey.SurveyYear, Survey.QuestCode, Survey.AnswerCode
HAVING (((TargetAreas.TargetParent)=[Forms].[Chart Report
Criteria].[USurvArea]) AND ((Survey.AnswerCode)=4) AND
((Year([Survey].[SurveyDate])*4+DatePart('q',[Survey].[SurveyDate])-1)>=(Year([forms].[Chart Report Criteria].[USurvYr])*4+(DatePart('q',Now())-1)-1)-7))
ORDER BY [SurveyYear] & "Q" & [SurveyQuarter], Survey.SurveyArea,
Survey.QuestCode, Survey.AnswerCode;
If I run the stored query "manually", I get the prompting for both of the
form controls and the query runs fine. When I run the chart "manually", I
get error messages that the Microsoft Jet database engine does not recognize
the form controls as valid field names. When I click OK on that message,
another pops up about sending data to the OLE Server. When I click OK there,
I get a blank chart, but I do get page headings. I get the same results when
running thru code.
Hopefully, this will help.
Thanks.
> Tell us about the Row Source of your chart control. Does it have a reference
> to a control on a form? Is the Row Source a crosstab query? Have you set any
[quoted text clipped - 59 lines]
> > > > > > will the code need to be totally re-written? I am extremely new to working
> > > > > > with Visual Basic.
Duane Hookom - 01 May 2008 18:08 GMT
The chart's Row Source is a crosstab query. All crosstab queries must have
the Query->Parameters data types set. You can do this either in the crosstab
or better yet in [qryStrongly Agree Chart]. Select Query->Parameters and
enter:
[Forms].[Chart Report Criteria].[USurvArea] ?datatype
[forms].[Chart Report Criteria].[USurvYr] ?datatype

Signature
Duane Hookom
Microsoft Access MVP
> The Chart Row Source statement is:
>
[quoted text clipped - 107 lines]
> > > > > > > will the code need to be totally re-written? I am extremely new to working
> > > > > > > with Visual Basic.
Martin - 01 May 2008 18:55 GMT
Thank you very much for the help so far. I did as you suggested and put the
Query Parameters in the stored query. Now, when I run the stored query
"manually" I get the prompts for the two fields, as expected. I did notice
that the stored query now has the following line added to the front of the
SQL:
PARAMETERS [Forms].[Chart Report Criteria].[USurvArea] Text ( 255 ),
[Forms].[Chart Report Criteria].[USurvYr] Short;
I still have the parameters as field criteria in the stored query
(qryStrongly Agree Chart).
When I run the report "manually", I get the same two field prompts, but they
are repeated--same names each twice. I double-checked to make sure I did not
add the Query Parameters to the crosstab and I did not. Only when running
the report do I get the double prompts; running the stored query only shows
one set of prompts.
The odd thing is that if I enter values for only one set of prompts, I still
get a blank report/chart. If I enter the same values into both sets of
prompts, I get a complete report.
Also, I see that when I close the Design View for the report, I am prompted
(once) for these two fields.
Thanks again.
> The chart's Row Source is a crosstab query. All crosstab queries must have
> the Query->Parameters data types set. You can do this either in the crosstab
[quoted text clipped - 114 lines]
> > > > > > > > will the code need to be totally re-written? I am extremely new to working
> > > > > > > > with Visual Basic.
Martin - 01 May 2008 19:29 GMT
I believe I have it nailed. I had to remove the field criteria that used one
of the form controls. Doing so does not allow the report to be run
"manually" as I like to do for testing, but it allows the report to run
properly from the code. That is what is important to me now anyway.
Thanks again for the help.
> Thank you very much for the help so far. I did as you suggested and put the
> Query Parameters in the stored query. Now, when I run the stored query
[quoted text clipped - 141 lines]
> > > > > > > > > will the code need to be totally re-written? I am extremely new to working
> > > > > > > > > with Visual Basic.