Solved

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

Posted on 2009-04-08
6
335 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
ID: 24096226
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
ID: 24096422
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
ID: 31567980
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 65

Expert Comment

by:rockiroads
ID: 24113986
No worries, glad we could all help :)
0
 
LVL 61

Expert Comment

by:mbizup
ID: 24114497
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
ID: 24114576
oooh, I didnt know that. Thanks for that bit of useful info.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

911 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

18 Experts available now in Live!

Get 1:1 Help Now