Bullsandbears123
Technical User
I have an object that I define and set in the main function. Then I try to reference the object within a sub function and it acts like I never defined the object. Is there a way to do this?
example
Function mymain(abc as string)
Dim objDatabase As Object
Dim objContact As Object
Set objDatabase = CreateObject("ACTOLE.DATABASE"
objDatabase.Open dbName
Set objContact = objDatabase.CONTACT
objDatabase.Open "dbName"
mysub(abc)
objDatabase.close
set objdatabase= nothing
set objcontact=nothing
end function
function mysub(myvar as string)
objContact.lookup myvariable
'some other stuff
end function
example
Function mymain(abc as string)
Dim objDatabase As Object
Dim objContact As Object
Set objDatabase = CreateObject("ACTOLE.DATABASE"
objDatabase.Open dbName
Set objContact = objDatabase.CONTACT
objDatabase.Open "dbName"
mysub(abc)
objDatabase.close
set objdatabase= nothing
set objcontact=nothing
end function
function mysub(myvar as string)
objContact.lookup myvariable
'some other stuff
end function