[AccessD] Public Variables - Scope and Lifetime

Bruen, Bruce Bruce.Bruen at railcorp.nsw.gov.au
Thu Nov 24 21:37:42 CST 2005


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.



More information about the AccessD mailing list