Solved

What is the difference between "Me.Recordset" and "Me.Report.Recordset" in an Access Report?

Posted on 2009-04-08
6
334 Views
Last Modified: 2013-11-28
I'm developing an Access 2007 "project" (.adp) as a front-end to a SQL Server 2005 Express database.

I have an Access "Report" that is based on a SQL Server "View".
I would like to trap the report (which is opened with a "WHERE" clause) if there are no records to print.

In the Report's "Report_Load" procedure I can check the "Me.Recordset.RecordCount" value, but I notice there is also a "Me.Report.Recordset.Recordcount" that can be checked.

Can someone explain the difference between a Report's "Me.Recordset" and "Me.Report.Recordset" and whether they are the same thing or might ever contain different values, and which of the two might be the more reliable to use?

Many thanks.
0
Comment
Question by:colinasad
  • 3
  • 2
6 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
Comment Utility
Could you not use the NoData event to capture a report with no data?

No real different between Me.Recordset and Me.Report.Recordset, not that I know off anyway
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 250 total points
Comment Utility
Like rocki said, I don't think there is a difference between Me.Recordset and Me.Report.Recordset in the context you are using this.

The .Report property does have its applications though.

Consider the following as a reference to a subreport:

Me.MySubreportName

That refers to the "subreport control", or container that houses the subreport.  You can use this to get/set properties such as the border of the subreport, the master/child links the enabled or visible properties...

However to refer to the controls and properties within the subreport, you would need to add the .reprort property:

Me.MySubreportName.Report

With this addition, you are referring to the subreport as a report, not just a container, so you can refer to its controls etc:

Me.MySubreportName.Report.Mytextbox
Me.MySubreportName.Report.Recordset
etc...
0
 

Author Closing Comment

by:colinasad
Comment Utility
Thanks for the prompt responses.
I have been "incomminicado" for a couple of days after posting the question.
I hope you don't mind me splitting the points because you both gave me good advice.
Many thanks.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
No worries, glad we could all help :)
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Ditto!

Rocki (and colinasad),

Just FYI, the "Grading Comments" that Askers post while closing questions are only visible to the Askers and Experts whose answers have been accepted.

To everyone else, It just looks like we struck up a random conversation. ;-)
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
oooh, I didnt know that. Thanks for that bit of useful info.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now