[AccessD] Public Variables - Scope and Lifetime

Borge Hansen pcs at azizaz.com
Fri Nov 25 00:30:39 CST 2005


Finally reverted to the old, tried and tested frmSystem hidden form!
As I walk the formatting of the main form and the two major subforms each having
three subforms, by referencing / setting value of a 'flag' text control on the
hidden frmSystem I can control the formatting and printing of the pageheader.
(final output of report is saved as RTF file and further formatted in Word;
found that a repeating groupheader label totally messes up the RTF file format,
sometimes the groupheader appears in the middle of the page in between the rows
of data, whereas according to the 'book' a repeating groupheader label should
appear on top of the page.... not so; hence the need for formatting and
controlling the printing of the pageheader depending on where in the report we
are....)

But, what am I missing for achieving the same using a global/public variable?

...hmmm maybe it's not a public variable that is needed but an object type of
thing?

... perhaps a framework?

;)

/borge

----- Original Message ----- 
From: "Bruen, Bruce" <Bruce.Bruen at railcorp.nsw.gov.au>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Friday, November 25, 2005 1:37 PM
Subject: Re: [AccessD] Public Variables - Scope and Lifetime


> If you declare it in both modules then you will have two variables!
>
> Decalre it in the main and reference it in the sub  --- without thinking
> me.parent.report.somethingorother.pbooletc
>
> Hth
> bruce
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Borge Hansen
> Sent: Friday, 25 November 2005 2:30 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Public Variables - Scope and Lifetime
>
> Hi all,
> Please help me here, I am going nuts!
>
> How do I keep the value of a public variable between a Main Report class
> module and Sub Report class module
>
> In the main report class module I have declared the variable:
>
> Option Compare Database
> Option Explicit
> Public pboolPrintPageHeader as boolean
>
> And Similar in the sub report class module:
> Option Compare Database
> Option Explicit
> Public pboolPrintPageHeader as boolean
>
>
> I just want a variable I can control the value of. When running the
> report it switches between the subreport and the mainreport.....
>
> regards
> /borge
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
>
> This e-mail and any attachments may contain confidential information that is
intended solely for the use of the intended recipient and may be subject to
copyright. If you receive this e-mail in error, please notify the sender
immediately and delete the e-mail and its attachments from your system. You must
not disclose, copy or use any part of this e-mail if you are not the intended
recipient. Any opinion expressed in this e-mail and any attachments is not an
opinion of RailCorp unless stated or apparent from its content. RailCorp is not
responsible for any unauthorised alterations to this e-mail or any attachments.
RailCorp will not incur any liability resulting directly or indirectly as a
result of the recipient accessing any of the attached files that may contain a
virus.
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list