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

Posted on 2008-10-28
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.
Question by:Mike Eghtebas
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22827436

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

LVL 74

Accepted Solution

Jeffrey Coachman earned 500 total points
ID: 22827457


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

Here is a sample:


LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 31510991
Thank you.

I have another one comming shortly.

LVL 34

Author Comment

by:Mike Eghtebas
ID: 22828004
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22828886

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

724 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