?
Solved

chart object, pop up the "Format Axis" dialog

Posted on 2008-10-10
12
Medium Priority
?
521 Views
Last Modified: 2013-11-28
I have a chart ('Microsoft Graph Chart') on my form. I want users to be able to change the scaling of the X and Y1 and Y2 axes of the chart. They can do this by:
  clicking on the chart
  double clicking again on the chart
  double clicking on the axis to select an axis
  righlt clicking and choose Edit Axis
and then they finally get to the "Format Axis" dialog

This is tedious and not obvious. Is there a way to pop up this Format Axis dialog for any axis by using my own command button? I know how to change the scale with VBA and reset it but I want that pop up dialog for the user so they can do interactively.
Format-axis.jpg
0
Comment
Question by:LukeB
[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
  • 6
  • 3
  • 2
12 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 1600 total points
ID: 22690186
In Excel you can run ommandbar execute to pop up the format axis - not a dialog as such but the same outcome is achieved

Cheers

Dave
  ActiveSheet.ChartObjects(1).Activate
     ActiveChart.Axes(xlValue).Select
     Application.CommandBars(48).Controls(1).Execute

Open in new window

0
 
LVL 1

Author Comment

by:LukeB
ID: 22696156
Hi Brett

ok, I am using Access2003. The Excel code you gave does  not work, I get error at the .Selett statement (your second line.). I tried both:
 chart_SWL.axes(1).select
and
 chart_SWL.ActiveChart.axes(1, 1).Select

where chart_SWL is my chart object

 
0
 
LVL 1

Author Comment

by:LukeB
ID: 22696178
PS:

I know how to do this way:
 http://support.microsoft.com/default.aspx?scid=kb;en-us;158938

but I want to have per my initial quetion, pop up that MS Graph 8 axis dialoge ...
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 50

Expert Comment

by:Dave Brett
ID: 22709981
Its been 10 years since I opened Access - I will ask Patrick Matthews to take a look

Regards

Dave
0
 
LVL 1

Author Comment

by:LukeB
ID: 22762584
Hi Brett,

Gentle reminder, any success?
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 22762621
Hi,

No takers ... so I suggest that you ask for the question to be deleted, and then repost it to get it visible again

Regards

Dave
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 400 total points
ID: 22773453
LukeB,

A few things are preventing this from being easy.

- The code must change the form from Form View to Design view.

- The code must Slect the chart

- The code must have a "Trigger" (Form, Toolbar, menubar) that puts the chart in "Edit" mode.

- The code must Select the Axis.

- The code must somehow invoke the Format Axis dialog box.

Each of these things alone will be difficult.

If, as you say, you can change the settings via code, then why not just create a form with all the various options, and present that to the user?

JeffCoachman
0
 
LVL 1

Author Comment

by:LukeB
ID: 22773481
Hi Jeff,

yes, true. But figured if the Excel boffins can do, like Brett shows above that they can, I reckoned the Access boffins can too?

Plus, no sense re-inventing the wheel if avoidable, which is good enough reason!

tx
Luke
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22777541
LukeB,

Yes, but in Excel there is no real "Design View" to contend with, like there is in Access.

Excel and Access are two different programs with to different Object Models.

For example: In Access you can bring up the "Print" dialog box fairly easilly (DoCmd.RunCommand acCmdPrint).
Because you are running the code while the form is in Form View.

If you are Viewing the form, the Graph Format Axis dialog box can only be accessed:
a. When the form is in Design view.
b. When the Chart itself is in "Edit" mode.

This is not the same situation you have in Excel.

So you may have "Reckoned" prematurely.
;-)

Now, I don't doubt that if you are willing to dedicate the time and energy to this, it can be done, I merely stated that it would not be "Easy"

;-)

JeffCoachman
0
 
LVL 1

Author Comment

by:LukeB
ID: 22781631
Jeff

Yes, ok. Thought would be easy, oh well. On the other hand, I don't really want users to be changing anything on the axis other than allowing a rescalling. Like don't want them changing the font,  line style , colour, etc

tx, Luke
0
 
LVL 1

Author Closing Comment

by:LukeB
ID: 31505155
thanks guys, balance of pts goes to Brett for he did offer a solution that works, albeti only for Excel at this point
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

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