Access 2000 How To's: Controlling Report DataDecember 12, 2002 OverviewIt is often the case where a developer will need to create an Access 2000 reports application capable of data selection -- for example, all transactions for a member. The data is input as parameters within a form and then passed to the report as query criteria. This is the simplest method to control report output resulting from user-selected data criteria.
Create a query called qryTransactions Include memberid, posteddate, amount, and code in the query field list
Create a columar report called rptTransactions
Create a form called frmReportParameters
Launch the Code
Option Explicit
Option Compare Database
Private Sub cmdLaunchTransactionReport_Click()
On Error GoTo Err_cmdLaunchTransactionReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim sCriteria
sCriteria = "[MemberId]=" & txtMemberId
stDocName = "rptTransactions"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
Exit_cmdLaunchTransactionReport_Click:
Exit Sub
Err_cmdLaunchTransactionReport_Click:
msgbox Err.Description
Resume Exit_cmdLaunchTransactionReport_Click
End Sub
Run the Form
|
||||||||||||