Include or Exclude Microsoft Access Modern Chart Columns with VBA
Question details
The user wants to control which data columns appear in a Microsoft Access modern chart using VBA.

- Product
- Microsoft Access modern charts
- Device & OS
- not provided
- Scenario
- A modern chart needs to show or omit columns as its data source changes.
- Observed behavior
- The chart should use the selected source fields, while retaining appropriate series formatting where possible.
Open the form or report containing the modern chart in Design View and identify the chart control name and the fields in its source query. Decide which fields the chart needs for its category and values before changing the source.
Update the chart's RowSource and ChartValues with VBA
Use this approach to change the fields available to a modern chart and specify which field supplies its values.
Update the underlying query or the chart's RowSource rather than trying to edit TransformedRowSource, which is read-only. Keep the category field and any other fields needed by the chart in the source.
Changing the source can affect series formatting, so review the chart after each source change.
In Access, open the form or report in Design View, select the chart, and use its Property Sheet to identify the control name and current Row Source.
Open the source query in Query Design or SQL View and choose the fields to include. Remove unwanted fields from the SELECT statement, while retaining the fields needed for the chart's category and values.
Open the form or report's VBA module and, in the appropriate event procedure, set the chart control's RowSource to the updated query or SQL statement. Set its ChartValues property to the field or fields that should supply the chart values.
Run the event procedure, refresh or requery the chart control, and inspect the displayed series. If colors, labels, or other series formatting have changed, adjust them in the chart settings.

Create spreadsheet charts with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheet data and charts. Its Microsoft Excel format compatibility helps you move spreadsheet work easily, though it does not fix Access chart VBA or replace an Access database.

Frequently Asked Questions
Can I edit TransformedRowSource to change a modern chart?
No. TransformedRowSource is read-only. Update the underlying query or set the chart's RowSource in VBA instead.
How do I choose which field provides chart values?
Set the chart control's ChartValues property in VBA to the desired field or fields, and make sure they are included in the chart's RowSource.
Why did my chart colors or series formatting change?
Changing the source can alter how Access identifies chart series. Refresh the chart after the change and review its series formatting in the chart settings.
Can WPS Office run the Access chart VBA?
No. WPS Office can create spreadsheet charts, but it does not fix or run Microsoft Access modern chart VBA. Use Access to update the database chart.




