=> transfer value in textbox on form to textbox on Report

  • Thread starter Thread starter Rhonda Fischer
  • Start date Start date
R

Rhonda Fischer

Hello,

On clicking a button on a form I generate a report
of Supplier Revenue. I would like to transfer the
'from' and 'to' date to the Report. I tried the following
code on Report_Open without success:

Me.txtDateFrom = [Forms]![frmReportCriteria]!txtDateFrom
Me.txtDateTo = [Forms]![frmReportCriteria]!txtDateTo

Any suggestions you may have would be very much
appreciated.

Kind Regards
Rhonda
 
Assuming the form is left open, you can set the control source of your text
box to:
=[Forms]![frmReportCriteria]!txtDateFrom
 
Dear Duane,

Thank you for your response.

The error message I receive when I use the following
code is: 'You can't assign a value to this Object'


Private Sub Report_Open(Cancel As Integer)

txtFromDate = [Forms]![frmReportCriteria]!txtDateStart
txtToDate = [Forms]![frmReportCriteria]!txtDateEnd

End Sub


Any ideas, thank you :)
Rhond


-----Original Message-----
Assuming the form is left open, you can set the control source of your text
box to:
=[Forms]![frmReportCriteria]!txtDateFrom
--
Duane Hookom
MS Access MVP


Hello,

On clicking a button on a form I generate a report
of Supplier Revenue. I would like to transfer the
'from' and 'to' date to the Report. I tried the following
code on Report_Open without success:

Me.txtDateFrom = [Forms]![frmReportCriteria]!txtDateFrom
Me.txtDateTo = [Forms]![frmReportCriteria]!txtDateTo

Any suggestions you may have would be very much
appreciated.

Kind Regards
Rhonda


.
 
Rhonda, you cannot assign a value to a control in Report_Open.

As Duane suggested, drop the code, and set the Control Source of the text
box instead.

If you have a reason not to do that, then use the Format event of the
section that contains the control instead of the Open event of the report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rhonda Fischer said:
Dear Duane,

Thank you for your response.

The error message I receive when I use the following
code is: 'You can't assign a value to this Object'


Private Sub Report_Open(Cancel As Integer)

txtFromDate = [Forms]![frmReportCriteria]!txtDateStart
txtToDate = [Forms]![frmReportCriteria]!txtDateEnd

End Sub


Any ideas, thank you :)
Rhond


-----Original Message-----
Assuming the form is left open, you can set the control source of your text
box to:
=[Forms]![frmReportCriteria]!txtDateFrom
--
Duane Hookom
MS Access MVP


Hello,

On clicking a button on a form I generate a report
of Supplier Revenue. I would like to transfer the
'from' and 'to' date to the Report. I tried the following
code on Report_Open without success:

Me.txtDateFrom = [Forms]![frmReportCriteria]!txtDateFrom
Me.txtDateTo = [Forms]![frmReportCriteria]!txtDateTo

Any suggestions you may have would be very much
appreciated.

Kind Regards
Rhonda
 
Back
Top