Forum Discussion
Modern Chart - adding Dynamic Chart Subtitle?
- Sep 03, 2022Yes - use DLookup
Me.Chart0.ChartSubtitle = DLookup("FieldName", "Table/QueryName", "FilterCriteria")
e.g.
Me.Chart0.ChartSubtitle = DLookup("MyDateTime2", "t_Graphdata", "MyDataID = 4456")
You just need to read the properties sheet to see what is available:
For example, if your chart is Chart0, then add code like this to the Form_Load event:
Me.Chart0.ChartTitle = "Your Chart Title Here"
Me.Chart0.HasSubtitle = True
Me.Chart0.ChartSubtitle = "Your Subtitle Here"
- Tony2021Sep 03, 2022Iron Contributor
ah Ok I see.
Could I refer to a query somehow?
In the below, I manually type the Chart Subtitle and it comes from a query and I would like to somehow refer to the query to avoid manually typing making it more dynamic.
- isladogsSep 03, 2022MVPYes - use DLookup
Me.Chart0.ChartSubtitle = DLookup("FieldName", "Table/QueryName", "FilterCriteria")
e.g.
Me.Chart0.ChartSubtitle = DLookup("MyDateTime2", "t_Graphdata", "MyDataID = 4456")- Tony2021Sep 04, 2022Iron Contributor
Hi IslaDogs,
I have a quick follow up when you have a sec.
Do you happen to know how to break a long ChartSubtitle line into 2 lines?
I thought by adding a continuation character would break it into 2 lines but that didnt seem to work as its still in 1 long line.Wondering if you happen to know of a workaround?