Filter reports based on a subform

terces

Registered User.
Local time
Today, 20:15
Joined
Aug 8, 2011
Messages
23
Hi to All,

I have a main form (frmMain) and a subform (frmReport) where i select comboboxes and option frame wherein i have encoded in the search and preview button the ff:
__________________________________________
Private Sub cmdPreview_Click()

If Me.fmeReport = 1 Then DoCmd.OpenReport "rptProjects", acViewPreview
If Me.fmeReport = 2 Then DoCmd.OpenReport "rptProponent", acViewPreview
If Me.fmeReport = 3 Then DoCmd.OpenReport "rptPhysical", acViewPreview
If Me.fmeReport = 4 Then DoCmd.OpenReport "rptFinancial", acViewPreview
If Me.fmeReport = 5 Then DoCmd.OpenReport "rptTechnical", acViewPreview
If Me.fmeReport = 6 Then DoCmd.OpenReport "rptCPAR", acViewPreview
If Me.fmeReport = 7 Then DoCmd.OpenReport "rptPRA", acViewPreview
If Me.fmeReport = 8 Then DoCmd.OpenReport "rptProject", acViewPreview
If Me.fmeReport = 9 Then DoCmd.OpenReport "rptOther", acViewPreview
Me.Parent.cmdReport.SetFocus

Private Sub cmdSearch_Click()
If Me.fmeReport = 1 Then DoCmd.OpenReport "rptProjects", acViewReport
If Me.fmeReport = 2 Then DoCmd.OpenReport "rptProponent", acViewReport
If Me.fmeReport = 3 Then DoCmd.OpenReport "rptPhysical", acViewReport
If Me.fmeReport = 4 Then DoCmd.OpenReport "rptFinancial", acViewReport
If Me.fmeReport = 5 Then DoCmd.OpenReport "rpttechnical", acViewReport
If Me.fmeReport = 6 Then DoCmd.OpenReport "rptCPAR", acViewReport
If Me.fmeReport = 7 Then DoCmd.OpenReport "rptPRA", acViewReport
If Me.fmeReport = 8 Then DoCmd.OpenReport "rptProject", acViewReport
If Me.fmeReport = 9 Then DoCmd.OpenReport "rptOther", acViewReport
Me.Parent.cmdReport.SetFocus
End Sub
_____________________________

In the mean time I would like to know what are the codes to be used if im going to filter the data by the record selected on the frmReport comboboxes and refresh them after i generated/preview a report.

Thanks to all.
 

Attachments

I solved this matter after experimenting queries for the whole afternoon. Please close this thread. thanks
 

Users who are viewing this thread

Back
Top Bottom