PivotTable object reference syntax

M

Michael D

I am using Access VBA within an Access 2003 database. I've created a
PivotTable form and in my FormLoad module I set (or Reset) the objects on
this PivotTable form. My problem is trying to find the full object model to
know how to reference the object I want to update the 'backcolor' property
using VBA.

I can set the 'caption' property of a Column heading object with this code:
Me.PivotTable.ActiveView.ColumnAxis.FieldSets(0).Fields(0).Caption = "Event"

but I can't reference or find the correct syntax to update the 'backcolor'
property of the same object. It can be done manually via the right-click over
the object, then in the 'Properties' form on the 'Format' tab in the Cell
format section of this tab, I can change the 'Background color' using this
control. What I want to know is how to do the same thing via VBA each time I
start the PivotTable form?

I've tried:
Me.PivotTable.ActiveView.ColumnAxis.FieldSets(0).Fields(0).BackColor =
vbYellow
but I keep getting an error message "438 - Object doesn't support this
property or method".

Can anyone help please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top