Re: REPRESENT graph/PIE in form based result of query
Then you are in the wrong forum...should be office development.
MSChart may work in VBA, not sure....anyway,,,,here is an example in VB6.
Code:
Option Explicit
Private Sub Form_Load()
MSChart1.chartType = VtChChartType2dPie
MSChart1.ColumnCount = 12
MSChart1.RowCount = 1
List1.AddItem ("1-5751")
List1.AddItem ("2-7464")
List1.AddItem ("3-7995")
List1.AddItem ("4-7805")
List1.AddItem ("5-7051")
List1.AddItem ("6-8431")
List1.AddItem ("7-8946")
List1.AddItem ("8-3068")
List1.AddItem ("9-5654")
List1.AddItem ("10-3456")
List1.AddItem ("11-6389")
List1.AddItem ("12-5498")
Dim chartArray(11) As Integer
Dim x As Integer
Dim monTrans() As String
For x = 0 To List1.ListCount - 1
List1.ListIndex = x
monTrans() = Split(List1.Text, "-")
chartArray(x) = monTrans(1)
Next x
MSChart1.ChartData = chartArray
End Sub
I'll ask a moderator to move this Thread to the proper forum.