Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / February 2005

Tip: Looking for answers? Try searching our database.

Referencing a Subreports field in a report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnB - 24 Feb 2005 17:46 GMT
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
AlCamp - 24 Feb 2005 22:26 GMT
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]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.