Create a report from current record in form
Posted on 2001-06-06
I have a form (frmProposal) which gets its data from a query that combines two tables (tblCustomers and tblBidDescription). There is a report (rptProposal) that uses the data from another query (qryProposal) to generate (surprise!!) a proposal. I am looking to open the rptProposal from the frmProposal using the [ProposalNumber] on the frmProposal. I have tried using an EventProcedure in the OnClick property of the Command Button that opens rptProposal:
Private Sub PreviewProposal_Click()
On Error GoTo Err_PreviewProposal_Click
Dim stDocName As String
stDocName = "rptProposal"
DoCmd.OpenReport stDocName, acPreview, "[ProposalNumber]=" = Me![ProposalNumber]
However, this still opens ALL proposals. How can I just get it to open the Report using ONLY the Proposal based off of the record I am working on and not every record in the database.