Where clause in Button?

  • Thread starter Thread starter SFKC
  • Start date Start date
S

SFKC

Hi,

I have a form to view reports by selected dates. While trying to put the
criteria in the button, I found that it did not work. Could someone advice

Dim CrStg As String

CrStg = "TransactionDate Between #" & Forms![frmReportByDate]![cboFrom] & "#
And #" & Forms![frmReportByDate]![cboTO] & "#"

DoCmd.OpenReport Me.lstReports, acViewPreview, , CrStg


SF
 
You need to explain "did not work". "Did not work" doesn't give much info.
for others to analyse.

Do you mean the code did not run? The code ran but the Report didn't appear
on screen? The Report appeared but the "wherecondition" criteria didn't
eliminate Records / rows from the Report?

The first thing you should check is that you assigned the correct bound
Columns for your ListBox and ComboBoxes. Secondly, check that the
[TransactionDate] is in the RecordSource for the Report.

Otherwise, you will have to provide more info. for others to analyse.
 
Back
Top