duncanstreet2004
MIS
Hi,
I'm just starting to program with VB, so this is a newbie question.
I'm building an application where I choose one of a number of reports, and the form for entering that report's parameters pops up, and then calls the viewer to display that report. The code one usually uses to display the report is something like this:
CRViewer91.ReportSource = Form2.rpt
In order to display a report generated from any one of a number of forms I imagine I need a public variable for a form, which I'll then use like this:
CRViewer91.ReportSource = CallingForm.rpt
How should I set this up in the different code modules? I tried "Dim CallingForm as Form" in each form's general declarations area, then "Set CallingForm = Screen.ActiveForm" in the Form_Load event for each parameter form, but it didn't work. I'm sure it's easy if you know what you're doing, or at least I hope so.
Thanks so much.
Robin
I'm just starting to program with VB, so this is a newbie question.
I'm building an application where I choose one of a number of reports, and the form for entering that report's parameters pops up, and then calls the viewer to display that report. The code one usually uses to display the report is something like this:
CRViewer91.ReportSource = Form2.rpt
In order to display a report generated from any one of a number of forms I imagine I need a public variable for a form, which I'll then use like this:
CRViewer91.ReportSource = CallingForm.rpt
How should I set this up in the different code modules? I tried "Dim CallingForm as Form" in each form's general declarations area, then "Set CallingForm = Screen.ActiveForm" in the Form_Load event for each parameter form, but it didn't work. I'm sure it's easy if you know what you're doing, or at least I hope so.
Thanks so much.
Robin