Dear Expert,
I have try to Filter year using Between in query, but it fails to Filter it still display the year from the first combo i choose when both combo box is activated.
Kindly point me the mistake and guide how to correct it. I have attached the File sir. Also Here is the code where i use for filter the year using Between.
I have try to Filter year using Between in query, but it fails to Filter it still display the year from the first combo i choose when both combo box is activated.
Kindly point me the mistake and guide how to correct it. I have attached the File sir. Also Here is the code where i use for filter the year using Between.
Code:
If YearFromCheck.Value = 1 & YearUptoCheck.Value = 1 Then
ComboFrom.Enabled = True
ComboUpto.Enabled = True
rsview.Open "SELECT DateofBirth FROM test where Year(DateofBirth) BETWEEN '" & ComboFrom & "' AND '" & ComboUpto.Text & "'", con, adOpenStatic, adLockOptimistic
If rsview.BOF = True Or rsview.EOF = True Then
MsgBox " No Record Found : " & Me.ComboFrom.Text, Me.ComboUpto.Text
ComboFrom.Clear
ComboUpto.Clear
Exit Sub
Else
Do Until rsview.EOF = True
Set LI = ListView1.ListItems.Add(, , rsview(0))
ListView1.Refresh
For x = 1 To 8
LI.SubItems(x) = rsview(x)
Next x
rsview.MoveNext
Loop
End If
End If
'rsview.Close
'con.Close
'Set rsview = Nothing
'Set con = Nothing