R
Robert T
Hello:
I created a checkbook application that goes back several years so it has a
lot of transactions. I only want to print transactions within the last 30
days. I put the following script on the command button, however, Access keeps
printing every report.
Note: Trans_Date is a field in the child table called tblTransactions
Private Sub btnrptChecks_Click()
On Error GoTo Err_btnrptChecks_Click
Dim stDocName As String
Dim stWhereCondition As String
stDocName = "rptqryTblAccounts"
stWhereCondition = "[Trans_Date] > (Date()-30)"
DoCmd.OpenReport stDocName, acPreview, stWhereCondition
Exit_btnrptChecks_Click:
Exit Sub
Err_btnrptChecks_Click:
MsgBox Err.Description
Resume Exit_btnrptChecks_Click
End Sub
I created a checkbook application that goes back several years so it has a
lot of transactions. I only want to print transactions within the last 30
days. I put the following script on the command button, however, Access keeps
printing every report.
Note: Trans_Date is a field in the child table called tblTransactions
Private Sub btnrptChecks_Click()
On Error GoTo Err_btnrptChecks_Click
Dim stDocName As String
Dim stWhereCondition As String
stDocName = "rptqryTblAccounts"
stWhereCondition = "[Trans_Date] > (Date()-30)"
DoCmd.OpenReport stDocName, acPreview, stWhereCondition
Exit_btnrptChecks_Click:
Exit Sub
Err_btnrptChecks_Click:
MsgBox Err.Description
Resume Exit_btnrptChecks_Click
End Sub