Solved

Code help... Update RowSource of a chart on a report...

Posted on 2008-10-28
5
150 Views
Last Modified: 2013-11-28
Report rptABC in its detail section has a chart (Chart1). I need code to:

- Open rptABC in design mode (invisibaly or with echo off mode).
- Update the row source of Chart1.
- Save and close rptABC.
- Reopen rptABC in acPreview mode.

Thank you.
0
Comment
Question by:Mike Eghtebas
  • 3
  • 2
5 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22827436
eghtebas,

Something like this should get you started:

    DoCmd.OpenReport "YourReport", acViewDesign, , , acHidden
    Reports!rpt!chrt.RowSource = "YourNewQuerySource"
    DoCmd.Close acReport, "YourReport", acSaveYes
    DoCmd.OpenReport "YourReport", acViewPreview


JeffCoachman
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 22827457
eghtebas

Correction:

    DoCmd.OpenReport "YourReport", acViewDesign, , , acHidden
    Reports!YourReport!YourChart.RowSource = "YourNewQuerySource"
    DoCmd.Close acReport, "YourReport", acSaveYes
    DoCmd.OpenReport "YourReport", acViewPreview

Here is a sample:

Jeff

Access-EEQ23856214ChangeChartGra.mdb
0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 31510991
Thank you.

I have another one comming shortly.

Mike
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 22828004
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22828886
;-)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question