Consulting

Results 1 to 1 of 1

Thread: changing chart title using vba in access

  1. #1
    VBAX Regular
    Joined
    Aug 2006
    Posts
    17
    Location

    changing chart title using vba in access

    I have a chart in a form in Msaccess XP. The user can choose which group he wishes to see the results on. I have everything working including the charts dynamically changing however for the icing on the cake it would be nice to change the title to include the current group that the chart is related to, dependant on a combo box selection. The code below will change the title but I can't work out how to construct it to all me to pass in the chartname variable.

    In the below code chtTrust is the actual chart name and strChtTitle is the new title variable. I would like to pass in chtTrust as a variable so I can use the code for 2 other charts chtHospital and chtWard


    [vba]
    Sub chtTitlechange(strChtTitle As String)

    With Me.chtTrust.Object.Application.Chart
    .charttitle.Text = strChtTitle 'Me.txtbox.Value
    End With

    End Sub

    [/vba]

    Any ideas please

    I have referenced microsoft graph but cannot seem to get it to run
    Last edited by lucky245; 07-28-2010 at 11:54 AM.

Posting Permissions

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