473,513 Members | 3,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5759
-----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
3300
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 city_id 1 john newyork null
4
1715
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 = 'Win98'; else if (1+v.indexOf('WINNT') os = 'WinnT';
8
4318
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. Basically I want to say: If fk_ID is in list then do these statements to that record
3
3087
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 Year to Month Year) So far i have tried to use the following code: //
5
4475
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 including the -q64 option in xlC compiler. And we are able to link all these libraries to one of the main applications and generate an executable....
1
1020
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
2250
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 allows a user to select data for the report. I have a hidden txt object within this form named txtContinue which is either set to “no” or “yes”. I...
7
2175
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 typedef'd to have the type name 'event.' It's a simple open hash table used to implement events in a game. So, I have a routine that returns the address...
4
1395
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 die(mysql_error());
0
1510
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 since. Kid gloves with me would be awesome. The Background: I am pulling data out of student management system (OS/400 /DB2) into Crystal...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.