[AccessD] checking on form module lilfetime

Dan Waters dwaters at usinternet.com
Sun Aug 17 16:11:20 CDT 2008


Hi Susan,

You do need to define global variables in a standard module, but once
defined they can be used anywhere.

For example in a standard module:

	Public GstgReportOpenArgs as String

I use this in Access 2000 apps because the reports don't have an OpenArgs
function.

In a form:

	GstgReportOpenArgs = "something"
	DoCmd.OpenReport "rptReport"

In the report's Open event:

	"something" = GstgReportOpenArgs

There is a drawback to using global procedures - if you app has an error the
value of all global variables is lost.  However, this may only be true with
untrapped errors, but I don't know for sure.  Anyone know this?

I use a single standard module where all my Global Variables are defined.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Sunday, August 17, 2008 3:30 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] checking on form module lilfetime

Isn't it true that you can't create an application-life variable in a form 
or report module? You need a standard module, right?

Susan H. 

-- 
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