hey
im trying to search my listview by date
i get error type mismatch why?
this is the datepicker
this is the code of load
im trying to search my listview by date
i get error type mismatch why?
this is the datepicker
Code:
Private Const mstrDateFormat As String = "dd-mm-yyyy"
Private Sub DTPicker1_CloseUp()
Dim lvi As ListItem
Dim j As Long
Dim d As Date
d = Format$(DTPicker1.Value, mstrDateFormat)
For j = FrmInvoices.LsVw.ListItems.Count To 1 Step -1
Set lvi = FrmInvoices.LsVw.ListItems(j)
If DateDiff("d", CDate(lvi.SubItems(2)), d) <> 0 Then
FrmInvoices.LsVw.ListItems.Remove (j)
End If
Next
End Sub
Code:
Private Sub Form_Load()
Me.WindowState = 2
ListRTL LsVw
mLVClrHdr.HookToLV LsVw.hwnd, True
mLVClrHdr.glHdrBkClr = &HD1B499
mLVClrHdr.glHdrTextClr = vbWhite
m_hookedLV = True
Set RS = CN.Execute("SELECT * from Inventory ")
While Not RS.EOF
Set Itm = FrmInvoices.LsVw.ListItems.Add(, , RS!InvDate, , "invoice")
Itm.bold = True
Itm.SubItems(1) = RS!InvInvoice
Itm.SubItems(2) = RS!InvItem
Itm.SubItems(3) = RS!InvSupplier
Itm.SubItems(4) = RS!InvCompany
Itm.SubItems(5) = RS!invQuantity
Itm.SubItems(6) = RS!InvRemarks
RS.MoveNext
Wend
End Sub