?
Solved

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

Posted on 2008-10-28
5
Medium Priority
?
154 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
[X]
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
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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 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