0

Hello there, How can I print a records which has a date from Combo1.text to Combo2.text

Here is my codes..There are two combobox and I want to do is when the user chose a date like From 1/12/2014 to 1/20/2014 all the records from that dates will be printed only.

Set rx = New ADODB.Recordset
If Combo1.Text = "" And Combo2.Text = "" Then
MsgBox "The boxes are empty!"

Else
With rx
    .Open "select * from tbl_studinfo order by findings asc", con, 3, 3
 If Combo1.Text = .Fields("date") And Combo2.Text = .Fields("date") Then
    Set DataReport20.DataSource = rx
    DataReport20.Sections("section4").Controls.Item("label3").Caption = Date
    DataReport20.Show vbModal
    rx.Close
Else
MsgBox "No Records Available"
    Combo1.Text = ""
    Combo2.Text = ""
    Set rx = Nothing

    End If

End With
End If
2
Contributors
1
Reply
7
Views
3 Years
Discussion Span
Last Post by abelingaw
0
 rs.Open "Select * from TABLENAME where COLUMNFORTIME Between #" & Combo2.Text & "# AND #" & Combo1.Text & "#;", con, adOpenKeyset, adLockPessimistic

Perhaps..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.