URGENT!!!!
Hi all
nice to see you again
i have a problem filter chart used checkbox
i want to show all result in one chart
its mean i have two field (2 legend) and i want to show it into
mschart1 by selecting checkbox that i need to show
so i can choose it
i has been write some code but its only show one result
whereas i has been click all checkbox and necessarily all result its
show
please help my code
thanks all
NOTE : I`m Sorry my speaking english was very bad
=======================================================
Dim matrizValores1() As Variant
Dim matrizValores2() As Variant
Dim i As Integer
start1 = DTPicker1.Value
start2 = DTPicker2.Value
driver = TxtID.Text
Set AdodcGrafico = New Recordset
AdodcGrafico.ActiveConnection = con
AdodcGrafico.CursorType = adOpenStatic
AdodcGrafico.CursorLocation = adUseClient
AdodcGrafico.LockType = adLockOptimistic
straddand = ""
strsql = "SELECT * FROM dssmonthly WHERE "
strsql = strsql & " date >='" & (start1) & "'" & "AND date <='" &
(start2) & "'"
straddand = " AND"
strsql = strsql & straddand & " drivers='" & (driver) & "'"
strsql = strsql & " order by date"
AdodcGrafico.Open strsql
'==================================================================
'For Current Score (1st Legend)
'==================================================================
If Check1.Value = vbChecked Then
If AdodcGrafico.RecordCount > 0 Then
ReDim matrizValores1(1 To AdodcGrafico.RecordCount, 1 To 2)
AdodcGrafico.MoveFirst
i = 1
Do While Not AdodcGrafico.EOF
matrizValores1(i, 1) = AdodcGrafico!Date
matrizValores1(i, 2) =
AdodcGrafico.Fields("currentscore")
AdodcGrafico.MoveNext
i = i + 1
Loop
MSChart1.ChartData = matrizValores1
MSChart1.Plot.SeriesCollection(1).LegendText = "Current
Score"
MSChart1.TitleText = "Chart dari Current Score"
MSChart1.Plot.Axis(VtChAxisIdX, 0).AxisTitle.Text = "Date"
Else
MSChart1.ChartData = Array(0, 0)
End If
End If
'===================================================================
'For totaldistance (2nd Legend)
'===================================================================
If Check2.Value = vbChecked Then
If AdodcGrafico.RecordCount > 0 Then
ReDim matrizValores2(1 To AdodcGrafico.RecordCount, 0 To 2)
AdodcGrafico.MoveFirst
i = 1
Do While Not AdodcGrafico.EOF
matrizValores2(i, 1) = AdodcGrafico!Date
matrizValores2(i, 2) =
AdodcGrafico.Fields("totaldistance")
AdodcGrafico.MoveNext
i = i + 1
Loop
MSChart1.ChartData = matrizValores2
MSChart1.Plot.SeriesCollection(1).LegendText = "Total
Distance"
MSChart1.TitleText = "Chart dari Total Distance"
MSChart1.Plot.Axis(VtChAxisIdX, 1).AxisTitle.Text = "Date"
Else
MSChart1.ChartData = Array(0, 0)
End If
End If
Archived from group: microsoft>public>vb>syntax