hi! i have an application which will filter my access db for expiring dates and it will print using crystal report. the expiry date format on my database is as short text. so far this is my code. it prints the records but only when i choose the exact dates.i hope you could help me.
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
With frmReport
If chkPrintAll.Checked = False Then
Call OpenConnection()
Call Initialized()
With OleDa
.SelectCommand = New OleDbCommand()
.SelectCommand.CommandText = "SELECT * FROM [tblInfo] WHERE [ExpiryDate] BETWEEN '" & dtpPrintFrom.Text & "' AND '" & dtpPrintTo.Text & "'"
End With
.strReport = "Filter"
.strWhere = "{tblInfo.ExpiryDate} IN '" & dtpPrintFrom.Text & "' TO '" & dtpPrintTo.Text & "'"
Else
.strReport = "Print All"
End If
frmReport.ShowDialog()
End With
End Sub