Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Charts
Message
 
À
14/11/2001 16:24:48
Information générale
Forum:
Visual Basic
Catégorie:
Access
Titre:
Re: Charts
Divers
Thread ID:
00581782
Message ID:
00582399
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform