G
Guest
Repost of question from yesterday,
I didnt explain my question fully. I wanted to set the value of a reports
heading from VBA not from the form itself. I have 2 strings which are set
when the user selects certain controls on my form. I would like to apply
these to the report. I tried to apply them with the with statement below but
this doesnt work as Allen Brown explained. How can I set the properties of
the controls from VBA, I also tried to set them before the report is open but
this brings up the error rptDynamicTopSuppliers either does not exist or is
not open.
Hi
How can I set the value of a heading on a report from VBA.
I have tried.
With Reports![rptDynamicTopSuppliers
..txtHeading.Value = strHeading
..txtSubHeading.Value = strSubHeading
End With
But neothing is displayed in the text boxes. Can anyone help?
Thanks
Was this post helpful to you?
Reply Top
Allen Browne
11/25/2004 8:48 AM PST
Re: Automating Reports Title from Form
In: microsoft.public.access.formscoding
You cannot push the value from the form onto the report, because the report
must have it at the time it formats that section.
You can get the report to read the value from the form. For example, set the
Control Source property of the txtHeading text box on the report to:
=[Forms].[Form1].[text1]
I didnt explain my question fully. I wanted to set the value of a reports
heading from VBA not from the form itself. I have 2 strings which are set
when the user selects certain controls on my form. I would like to apply
these to the report. I tried to apply them with the with statement below but
this doesnt work as Allen Brown explained. How can I set the properties of
the controls from VBA, I also tried to set them before the report is open but
this brings up the error rptDynamicTopSuppliers either does not exist or is
not open.
Hi
How can I set the value of a heading on a report from VBA.
I have tried.
With Reports![rptDynamicTopSuppliers
..txtHeading.Value = strHeading
..txtSubHeading.Value = strSubHeading
End With
But neothing is displayed in the text boxes. Can anyone help?
Thanks
Was this post helpful to you?
Reply Top
Allen Browne
11/25/2004 8:48 AM PST
Re: Automating Reports Title from Form
In: microsoft.public.access.formscoding
You cannot push the value from the form onto the report, because the report
must have it at the time it formats that section.
You can get the report to read the value from the form. For example, set the
Control Source property of the txtHeading text box on the report to:
=[Forms].[Form1].[text1]