Hi. If I have a report called rptReport, a Subreport
called rptSubreport and a text box called txtName in the
subreport, what would the On Format code in one of the
main reports sections be if I wanted to make the
subreport visable only if txtName had content?
Also, what would the code be if txtName was in the main
reports record source?
Is there a good on line reference for this type of thing?
Thanks for any help.
Cheers, JohnB
John,
I always use the "full" address to refer to a control...
Reports!rptReport!rptSubReport.Report!txtName
hth
Al Camp
> Hi. If I have a report called rptReport, a Subreport
> called rptSubreport and a text box called txtName in the
[quoted text clipped - 10 lines]
>
> Cheers, JohnB
JohnB - 25 Feb 2005 22:20 GMT
Thanks for this Al. Cheers, JohnB
>-----Original Message-----
>John,
[quoted text clipped - 19 lines]
>
>.
JohnB - 26 Feb 2005 12:37 GMT
Hi again Al. I didnt have much time to think about your
response when I replied. Do you think the following would
work for my example? Is the syntax correct?
Thanks, JohnB
IfNot IsNull Me!Reports!rptReport!rptSubReport.Report!
txtName Then Me!rptSubReport.Report.Visable = True
Else Me!rptSubReport.Report.Visable = False
>-----Original Message-----
>John,
[quoted text clipped - 19 lines]
>
>.
AlCamp - 28 Feb 2005 00:15 GMT
> Hi again Al. I didnt have much time to think about your
> response when I replied. Do you think the following would
[quoted text clipped - 34 lines]
>>
>>.
AlCamp - 28 Feb 2005 00:20 GMT
John,
You shouldn't need the Me! designations.
Also, it's report Report.Visible... not "visable".
There's no way I can say for ceratin that your code will work. Only you
can see the actual forms and controls.
hth
Al Camp
> Hi again Al. I didnt have much time to think about your
> response when I replied. Do you think the following would
[quoted text clipped - 34 lines]
>>
>>.
JohnB - 28 Feb 2005 10:58 GMT
Thanks again Al.
The reason I thought Id need Me! is, how else does Access
know that I need the code to relate to the records being
collected to show in that particular Reports section.
Without it and without a Where statement, how does Access
know which record to go for? Or does it do that
automatically?
For example, I have the following code in a Reports
section that controls the visibility of rptSubreport
depending on the content of field txtStatus in the main
Report. I think Ive repeated it correctly here but it
does work.
If IsNot IsNull Me!txtStatus Then
Me!rptSubreport.Visible = True
Else Me!rptSubreport.Visible = False
End If
Essentially I want to modify this code so that it looks
at a text field thats in the rptSubreport records, not
the main report ones.
Cheers, JohnB
>-----Original Message-----
>John,
[quoted text clipped - 46 lines]
>
>.