Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What properties are available during Class_Initialization

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
I am trying to generalize some code into a VB ActiveX dll for use with an Access database. Say I have this line of code in my form code: Set ctlActiveX = New MyActiveXControl,
where MyActiveXControl is registered via Tools References.

If I was doing this in VBA, I could pull the parent form name in during Class_Initialization with this line:
Set frm = Application.CodeContextObject

Is there an equivalent property in VB that I can use to minimize code in my calling form by doing something similar to the above?

Thanks in advance for any help you can give me!
 
I suspect that you're not going to be able to do what you describe - the "Application" object for VB is "App", but of course it's the program itself, whereas in Access it's Access.
Why does your form need a reference to its caller? What assumptions will your DLL have to make about the calling form and will this restrict the DLL's ability to be used in a general sense?
 
Thanks for the response, it was very helpful. I can still implement it even if I can't do the above.

I need a reference to the form before a couple class methods can be run. If I could do the above, then I can call those methods from Class_Initialize instead of calling them from the form with a . operator.

Its not a huge deal, just trying to get as much of the code into the class module as I can.

Have a great day!
 
Set up you class to require the form as a parameter, Pass it as "Me" from the form?

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top