hey
im trying to creats a graph that expenses each month but i get error syntax error
this is the code
these are the fields in my DB
the highlight is the error i get
tnx for help
im trying to creats a graph that expenses each month but i get error syntax error
this is the code
Code:
Private Sub Form_Activate()
Dim R As New ADODB.Recordset
CmbChType.text = CmbChType.List(0)
CmbChStyle.text = CmbChStyle.List(0)
R.Open "SELECT SUM(ExpQuantity) SUM (ExpCost) FROM Expenses " & _
"WHERE ExpID=ExpID AND ExpCost=mID GROUP BY ExpQuantity", CN, adOpenKeyset
If R.EOF Then Exit Sub
ReDim arrMn(1 To R.RecordCount, 1 To 2)
For I = 1 To R.RecordCount
arrMn(I, 1) = R.Fields(0)
arrMn(I, 2) = R.Fields(1)
R.MoveNext
Next
MSChart.ChartData = arrMn
End Sub
these are the fields in my DB
Code:
Itm.SubItems(1) = RS!ExpType
Itm.SubItems(2) = RS!ExpQuantity
Itm.SubItems(3) = FormatCurrency(RS!ExpCost)
Itm.SubItems(4) = RS!ExpInvoice
Itm.SubItems(5) = RS!ExpPament
Itm.SubItems(6) = RS!ExpCredit
Itm.SubItems(7) = RS!ExpBank
Itm.SubItems(8) = RS!Expfinal
Itm.SubItems(9) = RS!ExpRemarks
Itm.SubItems(10) = RS!ExpCardName
the highlight is the error i get
tnx for help