hi...hello..there...i've got a problem with my system developing...as much as possible i try to solve it to my own but nothing happen...i have an initial code below but the code are lack of necessary things that i want to happen...what i want is that when the caption of the combobox category is all..the different nmeitem will display with its total quantity...this code depends on the date between....using dtpicker....
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tblpos where date between #" & frminventory.DTPicker1.Value & "# and #" & DTPicker2.Value & "#; ", cn, adOpenKeyset, adLockPessimistic
With rs
' Dim total1 As Integer
Dim total As Integer
Dim amount As Double
Y = rs!Date
Z = rs!Date
Label7.Caption = .RecordCount
For X = 1 To .RecordCount
If .Fields("nmeitem") = Text1.Text And DTPicker1.Value = Z And DTPicker2.Value = Y Then
total = total + Val(.Fields("qitem"))
amount = total * .Fields("amount").Value
Label6.Caption = total
End If
.MoveNext
Next X
End With
With frminventory.ListView1.ListItems.Add(, , Text1.Text)
With .ListSubItems
.Add , , total
.Add , , amount
End With
End With