Click to See Complete Forum and Search --> : class modules


leary
May 5th, 2001, 08:58 PM
I have a class module and a bas. module but program is not reading global variables in class module. is there a compatability problem with having two different modules. if not, what could be the problem. if yoou need code i'll send it.

coolbiz
May 5th, 2001, 10:37 PM
How are you accessing the variable? Anyhow consider the following:

1. New Project w/ Form1 and Class1
2. In Class1 code:

option explicit

public bUseDebug as Boolean




3. In Form1 code

private sub Form_Load()
dim oClass as new Class1
debug.print "Debug Flag Before: " & oClass.bUseDebug
oClass.bUseDebug = true
debug.print "Debug Flag After: " & oClass.bUseDebug
end sub




When you run the code you should see FALSE and TRUE printed out in the Immediate Window.

Hope it helps,
-Cool Bizs

leary
May 6th, 2001, 01:46 AM
all variables were global,but upon a much closer look, something buried deep got switched around in shuffle and needed changed. however i saved your suggestion for future use thank you.