By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Set control property using variable for report name?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
-----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

P: n/a
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

P: n/a
Thanks! Worked like a charm! Amazing what a pair of parentheses will
do!

Feb 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.