Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jan 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing Graph Properties

    I have a graph embedded on a form which was created with the Wizard.
    I have a number of controls on the form to allow the user to define the RowSource for the Graph.
    I have a button on the form that runs code to set the Graph's Rowsource to what the User defined.
    So far, all is well...
    When this code fires off, I am trying to programmatically modify the Graph's Title as well.

    The Problem occurs only the first time I try to pull this off. I am told that Access is, "Unable to Set the HasTitle Property of the Chart Class."

    If I hit the 'End' button, the Rowsource stuff works, but the Title stuff fails. Hitting the command button a second time invariably works fine! And so do any subsequent changes to the RowSource. Every time I make a change, everything works fine after it fails once.

    Anyone got any ideas?

    Thanks,

    Rich Powers

  2. #2
    Star Lounger
    Join Date
    Apr 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Graph Properties

    My preference is to leave the title of the actual chart blank. Then I use a label/text box above where the chart is embedded for the title. This gives me easier coding access for titling.

  3. #3
    Lounger
    Join Date
    Jan 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Graph Properties

    Thanks for the post. But I need to have the approprate title within the graph because the users want to be able to copy it from the Access form and paste it into other applications as they see fit.

    I have come up with a workaround, but it still doesn't tell me why I need one. What I have done is modified the code so that when the user hits the 'Apply' button, the code checks to see if this is the first time the graph is being updated. If it is, then the update code runs twice with the 'On Error Resume Next' statement in between each pass.

    If it is not the forst pass at the graph, it worked fine anyway! It appears that the graph must initialize, or get drawn, or something, before I can modify some properties.

    Still looking for the answer...

    Thanks,

    Rich P.

  4. #4
    New Lounger
    Join Date
    Oct 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Graph Properties

    Hmmm,
    Better late than never, I hope.
    I used something like what's below....

    Me!chartPerf.hastitle = True
    Me!chartPerf.charttitle.Text = "This is a title"

    where chartPerf is the name of the chart.

    HTH
    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Lounger
    Join Date
    Jan 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing Graph Properties

    I was able to figure it out eventually. And I came up with exactly the same answer. It was so long ago, I can't even remember how I came across it, but I no longer need to count how many times the Graph has been updated. It works fine.

    Funny how little info there is out there in the world about controlling graphs programatically!

    Thanks again,

    Rich P.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •