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

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
 
D

Duane Hookom

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

Rhonda Fischer

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


.
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top