Hi experts out there, I'm using ms access to store a date value in (dd/mm/yyyy) format. This field too stores text value something like e.g: N/A. When user selects a date (dd/MM/yyyy) via dtpicker, i want the datagrid to be filtered by that date if it found in that date field else do nothing. But, when i run my program, it does nothing. My code:
Private Sub DTPicker1_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Dim rs2 As New ADODB.Recordset Dim SQL As String SQL = "Select * from tblECN where D_BOM=" & DTPicker1.Value & "" With rs2 .Open SQL, DB, adOpenStatic, adLockReadOnly Do While Not .EOF If IsDate(!D_BOM) = False Then Else datPrimaryRS.Recordset.Filter = "D_BOM='" & DTPicker1.Value & "'" End If .MoveNext Loop End With Set rs2 = Nothing End If End Sub
Please help me friends.