Results 1 to 4 of 4

Thread: MsChart problem...[RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2002
    Posts
    665

    Question MsChart problem...[RESOLVED]

    In Access (VBA) this code doesen't work. But in VB it works?
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim oleGrf As Object
    3.  
    4. Set oleGrf = Me.OLEchart.Object
    5.  
    6. oleGrf.ChartTitle.Text = "Test"
    7.  
    8. Set oleGrf = Nothing
    9.  
    10. End Sub

    Why?
    Last edited by Pirre001; Dec 12th, 2005 at 11:07 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: MsChart problem...

    Quote Originally Posted by Pirre001
    In Access (VBA) this code doesen't work. But in VB it works?
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim oleGrf As Object
    3.  
    4. Set oleGrf = Me.OLEchart.Object
    5.  
    6. oleGrf.ChartTitle.Text = "Test"
    7.  
    8. Set oleGrf = Nothing
    9.  
    10. End Sub

    Why?
    I don't know but I suspect the VBA people will.

    Moved to Office Development.

  3. #3
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: MsChart problem...

    Pirre
    Your syntax look right.

    Here is a one liner that should change your Chart Title

    VB Code:
    1. Me.OLEchart.Object.ChartTitle.Text = "Your text here"

    The attache Db shows this in action.
    Attached Files Attached Files
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2002
    Posts
    665

    Re: MsChart problem...

    Big Thanks Kenny!

Posting Permissions

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



Click Here to Expand Forum to Full Width