Solved

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

Posted on 2008-10-28
5
147 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 33

Author Closing Comment

by:Mike Eghtebas
ID: 31510991
Thank you.

I have another one comming shortly.

Mike
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 22828004
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22828886
;-)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now