add a MSChart control in ur application by
project->components->microsoft chart control
put a char in the form and
here i changed the name of chart control to cht and i use the able
With cht
.RowCount = 0
.ColumnCount = 0
If cmbName.ListIndex = -1 Then
sql = "Select Code,StockQty,(PrPrice * StockQty) As val from MstItem Where stockqty > 0 and void =0"
Else
sql = "Select Code,StockQty,(PrPrice * StockQty) As val from MstItem Where stockqty > 0 and void =0 and catcode='" & cmbName & "'"
End If
If RS.State Then RS.Close
RS.Open sql, CON, 1, 3
If RS.RecordCount < 1 Then
MsgBox "There is no item.", vbInformation, "Data not found"
If RS.State Then RS.Close
Exit Sub
End If
.RowCount = 1
.ColumnCount = RS.RecordCount
For I = 1 To RS.RecordCount
.Column = I
.ColumnLabel = RS("code")
.Data = RS("StockQty")
' RS.MoveNext
Next I
.AllowDynamicRotation = True
If RS.State Then RS.Close
End With