472,805 Members | 2,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Syntax for Reports! & GroupLevel

Hi there:

I can successfully control a report's GroupLevel ControlSource property by
using:

..Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"

where rptEESTMT_A is the actual name of the Access Report.

However, I have about 75 reports to process. Each report has its own unique
name. I don't want to create 75 different statements to process each of
the reports. For example:

..Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"
..Reports!rptEESTMT_B.GroupLevel(i).ControlSource = "CorpName"
..Reports!rptEESTMT_C.GroupLevel(i).ControlSource = "CorpName"
..Reports!rptEESTMT_D.GroupLevel(i).ControlSource = "CorpName"
and so on. This is long and tedious.

I created a function that would process each of the reports. I used a
string field called "sReportName" that stores the name of the Access Report
and used it in the statement:

..Reports!sReportName.GroupLevel(i).ControlSource = "CorpName"

However, VB comes back with an error message saying that: "The report name
'sReportName' you entered is misspelled or refers to a report that isn't
open or doesn't exist.". This means VB does not recognize the string
variable "sReportName" actually stores the name of the Access Report.

Can someone please give me suggestions on how to write a function that could
process the reports instead of writing out separate statement for each
Access Report.

Thanks in Advance

Andrew
Nov 12 '05 #1
2 5710
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try:

..Reports(sReportName).GroupLevel(i).ControlSource = "CorpName"

Reports is a collection. See the Access help articles on collections
to understand why the above works.

MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP8egDoechKqOuFEgEQLddwCfWfRgiRfM4kG7sWSHNIU7rM/ZIngAn0uN
GuFe4b4OLvglLiJ6n1AvdMOX
=/niS
-----END PGP SIGNATURE-----
Andrew wrote:
Hi there:

I can successfully control a report's GroupLevel ControlSource property by
using:

.Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"

where rptEESTMT_A is the actual name of the Access Report.

However, I have about 75 reports to process. Each report has its own unique
name. I don't want to create 75 different statements to process each of
the reports. For example:

.Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_B.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_C.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_D.GroupLevel(i).ControlSource = "CorpName"
and so on. This is long and tedious.

I created a function that would process each of the reports. I used a
string field called "sReportName" that stores the name of the Access Report
and used it in the statement:

.Reports!sReportName.GroupLevel(i).ControlSource = "CorpName"

However, VB comes back with an error message saying that: "The report name
'sReportName' you entered is misspelled or refers to a report that isn't
open or doesn't exist.". This means VB does not recognize the string
variable "sReportName" actually stores the name of the Access Report.

Can someone please give me suggestions on how to write a function that could
process the reports instead of writing out separate statement for each
Access Report.

Thanks in Advance

Andrew

Nov 12 '05 #2
Thank you for your help. It is working now. I can eliminate a lot of
repetitive codes. : )

"MGFoster" <me@privacy.com> wrote in message
news:9e*******************@newsread2.news.pas.eart hlink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try:

.Reports(sReportName).GroupLevel(i).ControlSource = "CorpName"

Reports is a collection. See the Access help articles on collections
to understand why the above works.

MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP8egDoechKqOuFEgEQLddwCfWfRgiRfM4kG7sWSHNIU7rM/ZIngAn0uN
GuFe4b4OLvglLiJ6n1AvdMOX
=/niS
-----END PGP SIGNATURE-----
Andrew wrote:
Hi there:

I can successfully control a report's GroupLevel ControlSource property by using:

.Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"

where rptEESTMT_A is the actual name of the Access Report.

However, I have about 75 reports to process. Each report has its own unique name. I don't want to create 75 different statements to process each of the reports. For example:

.Reports!rptEESTMT_A.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_B.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_C.GroupLevel(i).ControlSource = "CorpName"
.Reports!rptEESTMT_D.GroupLevel(i).ControlSource = "CorpName"
and so on. This is long and tedious.

I created a function that would process each of the reports. I used a
string field called "sReportName" that stores the name of the Access Report and used it in the statement:

.Reports!sReportName.GroupLevel(i).ControlSource = "CorpName"

However, VB comes back with an error message saying that: "The report name 'sReportName' you entered is misspelled or refers to a report that isn't
open or doesn't exist.". This means VB does not recognize the string
variable "sReportName" actually stores the name of the Access Report.

Can someone please give me suggestions on how to write a function that could process the reports instead of writing out separate statement for each
Access Report.

Thanks in Advance

Andrew


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
4
by: Ryan Gaffuri | last post by:
I know that this works. I just don't get the syntax. I know its checking the OS. just not sure how it works. var v = navigator.appVersion.toUpperCase() if (1+v.indexOf('WIN98') os =...
8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
3
by: KevLow | last post by:
Hi, Hope some kind soul can help me out here.. I'm trying to programmatically modify the column headings of a crosstab query such that it can be dynamic based on user specified period (Month...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
1
by: Rich | last post by:
Hello, What syntax can I use to reach an application file located in a different subfolder than the exe file? AppDir l__Bin l l__Debug l l__my.exe l
3
by: Birky | last post by:
Hello, I’m hoping you can help me out with two issues I’m having with my code. I have an Access Report named Report_Project_Event_Log which I have calling a Form named “Custom_Code_lookup” which...
7
by: Ray Dillinger | last post by:
Hi. I'm having a problem and I really want to understand it. Here's the situation: I have an array of pointers, and each pointer is the head of a linked list of structs. The structs are...
4
by: Call Me Tom | last post by:
I have the following PHP/MySQL code segment $query2="UPDATE reports SET fsacars_rep_url = $url_new WHERE pilot_id = $pid"; echo"$query2"; $result2=mysql_query($query2) or...
0
by: Brad King | last post by:
Hello all, I am going to describe my specific problem. Also, I can program in C++ & Java although I am a little rusty. I took both classes in order to get my MIS degree but have not touched them...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.