Re: global dim & set
From: Mike Labosh (mlabosh_at_hotmail.com)
Date: 07/29/04
- Previous message: Chad DeMeyer: "Re: ActiveDocument.PageSetup / Selection.PageSetup"
- In reply to: mcalex: "global dim & set"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 15:51:11 -0400
Open up any standard module (not a class or form module).
At the top of the code, you will see something like this:
Option Compare Database
Option Explicit
Right underneath those, do something like this:
Public g_bDebugMode As Boolean
When your application starts up, some code could set it to True.
Alternatively, you could declare the variable as a constant and then
manually change it when you want to see your messages:
Public Const DEBUG_MODE = True
-- Peace & happy computing, Mike Labosh, MCSD "Do not meddle in the affairs of dragons, for you are crunchy, and taste good with ketchup" "mcalex" <mcmcalex@netscape.net> wrote in message news:8986672e.0407261949.6cb2cc03@posting.google.com... > Hi all > I'm a bit new to vb, and want to know if there is a way of declaring > and setting a global variable outside of any procedures. I have a > public boolean (debugOn) that runs my debug.print statements if true > and doesn't clutter the immediate window if false. Everything's fine > as long as I set it within procedures, but I cannot convince VBA to > set it outside of a procedure, ie at declaration time. Is this > possible? and if so, how? > > Many thanks > Alex
- Previous message: Chad DeMeyer: "Re: ActiveDocument.PageSetup / Selection.PageSetup"
- In reply to: mcalex: "global dim & set"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|