Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

713 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