I have two forms where the user can choose what should appear on the report. For example, the user can select a date range or a date type. On these two forms there are several text boxes that fill using VB Code, depending on what is chosen on the form. One of these text boxes (txtReportTitle) holds the title that should appear on the report.
I can't figure out how to get this title on the report (I would like both forms to use the same report so I don't have to have two similar reports). Among many other things, I tried using the IsLoaded function, which I copied from the Northwind database. I put this in the Open event of the Report, but I get an error that says I "can't assign a value to this object."
Does anyone know how I can pass the title to the report from either form?
Here's the code I currently have on the report's Open event:
Private Sub Report_Open(Cancel As Integer)
If IsLoaded("Form_frmReportHiRise") = True Then
txtTitle = Form_frmReportHiRise.txtReportTitle
Else
txtTitle = Form_frmReportFamily.txtReportTitle
End If
End Sub
Thanks...Laurie
I can't figure out how to get this title on the report (I would like both forms to use the same report so I don't have to have two similar reports). Among many other things, I tried using the IsLoaded function, which I copied from the Northwind database. I put this in the Open event of the Report, but I get an error that says I "can't assign a value to this object."
Does anyone know how I can pass the title to the report from either form?
Here's the code I currently have on the report's Open event:
Private Sub Report_Open(Cancel As Integer)
If IsLoaded("Form_frmReportHiRise") = True Then
txtTitle = Form_frmReportHiRise.txtReportTitle
Else
txtTitle = Form_frmReportFamily.txtReportTitle
End If
End Sub
Thanks...Laurie