Help with data report
Can you pass a variable from a form to a data report? I need to change a
company name on a data report based upon what the user picks on a form.
I have dim'd the variable as public but can not get the data report to recognize
it. Can this be done?
Re: Help with data report
"shannan" <firstname.lastname@example.org> wrote:
>Can you pass a variable from a form to a data report? I need to change
>company name on a data report based upon what the user picks on a form.
>I have dim'd the variable as public but can not get the data report to recognize
>it. Can this be done?
You might want to use a Property Get rather than a Public variable, it's
a little cleaner. Try something like this-
In your form module, add a Property Get to pass the Company Name to the report:
(Assuming you are using a ComboBox to let the user choose the company name)
Public Property Get CompanyName() As String
CompanyName = cmbCompanyName.Text
Then, in the DataReport_Initialize event do something like this:
(This assumes that your Company Name label is in the "PageHeader" section
of your report).
Private Sub DataReport_Initialize()
Dim lbl As RptLabel
Set lbl = .Controls("lblCompanyName")
lbl.Caption = frmMyForm.CompanyName
Set lbl = Nothing
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL