Office & Productivity Software forum

General discussion

MS Access Graph - display only selected data labels

I have a line graph myGraph that has three
series "P1","P2" and "P3" and I want to display labels
only where the points in each series match records in
myTable. myTable has a field named "myType" and a second
field named myDate. Where myType matches the series name
and myDate matches the series point date is where the
label should appear.

Have tried looping through each record in myTable and then
setting the SeriesCollection index to myType and setting
the Points index to myDate and setting HasDataLabels =
True but I get an error 'Unable to set the Points property
of the series class'

My code looks like this

Sub SetDataLabels()

Dim db as Database
Dim rs as Recordset
Dim cht as Object
Dim strType as String
Dim strWeek as String

set db=CurrentDb
Set rs = db.OpenRecordset(myTable)
Set cht = myGraph

With rs


Do while not .EOF
strType =!TYPE
strWeek = !WEEK

myChart.SeriesCollection(strType).Points(strWeek).HasDataLabels = True


End With

End Sub

Discussion is locked
You are posting a reply to: MS Access Graph - display only selected data labels
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: MS Access Graph - display only selected data labels
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.

Popular Forums

Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


This one tip will help you sleep better tonight

A few seconds are all you need to get a better night's rest.