473,503 Members | 12,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set control property using variable for report name?

Hi,

I have a main menu that opens several different reports. I am adding
an OrderByOn, and currently have it set up for one report with the
following statements:
[Reports]![rptRoomDetails].OrderBy = strOrderBy
[Reports]![rptRoomDetails].OrderByOn = True

I would like to set those statements up using a variable for report
name. Is that possible? For instance, it would be something like:
dim strReportName as string
Reports!strReportName.OrderBy = strOrderBy

I know that can't be done, but is there anything to set up a property
using a variable?

thanks in advance.

Feb 23 '06 #1
4 8525
You're very close!

Try this:
Reports(strReportName).OrderBy = strOrderBy

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1125 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

"lorirobn" <lo******@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi,

I have a main menu that opens several different reports. I am adding
an OrderByOn, and currently have it set up for one report with the
following statements:
[Reports]![rptRoomDetails].OrderBy = strOrderBy
[Reports]![rptRoomDetails].OrderByOn = True

I would like to set those statements up using a variable for report
name. Is that possible? For instance, it would be something like:
dim strReportName as string
Reports!strReportName.OrderBy = strOrderBy

I know that can't be done, but is there anything to set up a property
using a variable?

thanks in advance.

Feb 23 '06 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Reports("the report's name").OrderBy = strOrderBy

E.g., my report's name is "Quarter Sales":

Reports("Quarter Sales).OrderBy = strOrderBy

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ/4mtoechKqOuFEgEQLH2ACfUDZFoqBz6vgXHMhh6AAhOMIY840A oIco
zp9zYO2uT/xIY/lUtaUBC+Og
=vffG
-----END PGP SIGNATURE-----

lorirobn wrote:
Hi,

I have a main menu that opens several different reports. I am adding
an OrderByOn, and currently have it set up for one report with the
following statements:
[Reports]![rptRoomDetails].OrderBy = strOrderBy
[Reports]![rptRoomDetails].OrderByOn = True

I would like to set those statements up using a variable for report
name. Is that possible? For instance, it would be something like:
dim strReportName as string
Reports!strReportName.OrderBy = strOrderBy

I know that can't be done, but is there anything to set up a property
using a variable?

Feb 23 '06 #3
To the original poster:

It is commonly accepted that these newsgroups are for free exchange of
information. Please be aware that PC Datasheet is a notorious job hunter.
If you are considering doing business with him then I suggest that you take
a look at the link below first.

http://home.tiscali.nl/arracom/whoissteve.html
"PC Datasheet" <no****@nospam.spam> wrote in message
news:ne*****************@newsread2.news.atl.earthl ink.net...
You're very close!

Try this:
Reports(strReportName).OrderBy = strOrderBy

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1125 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com

"lorirobn" <lo******@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi,

I have a main menu that opens several different reports. I am adding
an OrderByOn, and currently have it set up for one report with the
following statements:
[Reports]![rptRoomDetails].OrderBy = strOrderBy
[Reports]![rptRoomDetails].OrderByOn = True

I would like to set those statements up using a variable for report
name. Is that possible? For instance, it would be something like:
dim strReportName as string
Reports!strReportName.OrderBy = strOrderBy

I know that can't be done, but is there anything to set up a property
using a variable?

thanks in advance.


Feb 23 '06 #4
Thanks! Worked like a charm! Amazing what a pair of parentheses will
do!

Feb 23 '06 #5

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

Similar topics

8
3329
by: deko | last post by:
I'm hoping someone can sanity check my understanding of the Object Model for Forms/Controls. I'm having trouble drilling down into Control properties. First, I have a record set with the...
5
18235
by: Cro | last post by:
Hello Access Developers, I'd like to know if it is possible to perform a count in an expression that defines a control source. My report is based on a query. In my report, I want a text box to...
1
4446
by: Tom Louchbaum | last post by:
Can someonw pls tell me how to reference the Where clause made by the VBA statement DoCmd.OPENREPORT "Report",acviewpreview,,where as a control within the Report itself? Thanks.
6
11267
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
5
5925
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
4
3257
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
4
4461
by: Sevu | last post by:
I am working with ASP.NET.I am using ReportViwer Control to show my report.I like to add dropdownlist with in the reportviewer control. ( Not top to the control some thing like that).I need to...
7
2876
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
109
12684
by: bonneylake | last post by:
Hey Everyone, Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong. What the report is about is comparing my company's part price's to d and...
0
7193
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,...
0
7067
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...
0
7264
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,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
728
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.