>I have a chart embedded into MS Access 2000 using MS Graph. Currently, the chart has a query as a record source. The query has a timeframe hardcoded into it. Now, the user has requested the ability to select specific dates for the query. If I put the code in the query criteria field (Between [Enter beginning Date] And [Enter ending Date]), then try running the chart, it gives me an error that "Beginning Date" is invalid. Is there a way that I can have the chart run the query, ask the user to input a timeframe, and then show the chart?
>
>Also - This is the first time I have worked with charts in Access, so if anyone can point me to some good documentation I would appreciate it.
>
>TIA!!!!
Hi,
What you can do is to display a form (frmDates) with textfields: txtFrom, txtTo to enter dates. Then in the SQL statement in the rowsource of the Graph have references to those textfields:
Here is an example:
SELECT (Format([AddDate],"Short Date")) AS [Date], Count(*) AS
SumOfImagesCount FROM tblImages WHERE (((DateValue([tblImages].[AddDate]))
Between [Forms]![frmDates].[txtFrom] And [Forms]![frmDates].[txtTo])) GROUP BY
(Format([AddDate],"Short Date")), (Int([AddDate]));
HTH
Igor Gelin
Database Developer