Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:31:08+00:00 2026-06-04T18:31:08+00:00

I have been trying to add data labels to my pivot charts programmatically through

  • 0

I have been trying to add data labels to my pivot charts programmatically through VBA, but I can’t seem to figure it out. I’ve looked everywhere online, but nothing seems to work for my particular case.

Dim myForm As Form
Set myForm = Forms("My Form")

This may be fairly simple, but how do I access the ‘HasDataLabels’ property from there? I need to add it to two series.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:31:10+00:00Added an answer on June 4, 2026 at 6:31 pm

    Ethen,

    Here is a little VBA that can be used to add data labels to a form being viewed as a pie chart pivot chart. Please note, this code may cause errors if the form is not viewed as a pivot chart, because ChartSpace may not be available.

    Private Sub Form_Load()
      Dim FormChartSpace As owc10.ChartSpace
    
      Set FormChartSpace = Me.Form.ChartSpace
      FormChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection.Add
      FormChartSpace.Charts(0).SeriesCollection(0).DataLabelsCollection(0).HasValue = True
      Set FormChartSpace = Nothing
    End Sub
    

    You might find this link helpful as well: Programming PivotTable Reports in Microsoft Access 2002

    There are many ways to format charts in Access VBA. It has turned out to be more robust for my users when I create the entire chart programmatically, this avoids problems with users accidentally “corrupting” the charts by unknowingly dragging controls, because the chart is recreated from scratch each time the form is loaded.


    Using the code above requires a reference to OWC10 (Microsoft Office XP Web Components)

    1. On the Tools menu, click References.
    2. Click the Browse button.
    3. Browse to the file C:\Program Files\Microsoft Office\Office12\OFFOWC.DLL. (The location can change based on the version of office you have)
    4. Click the file, and then click Open. This adds a reference to the Microsoft Office XP Web Components library.
    5. Click OK to close the References dialog box.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to figure out a way of presenting data dynamically but have
At www.euroworker.no/order I have been trying to add a tooltip function but it seems
I have been trying to figure out how to add an image to my
I have been trying to figure out how to associate data with the event
I have been trying to add data from my ajax query that returns json
I've been trying to add Facebook Connect to a website, but it didn't seem
I have been trying to access data from another site by ajax but failed.
I have been searching all night for an answer to this but can't seem
I have been trying to add to the Watch window a Java Date object
I have been trying and trying and looking for ways/tutorials on how to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.