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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling form elements in ActiveX controls

Status
Not open for further replies.

capone67

Programmer
Joined
Nov 6, 2000
Messages
115
Location
CA
Hi Gang

I am working on an activeX control that has several forms in it. What I would like to do is be able to address objects that are on the usercontrol1 object from the forms but I get object required or "with block with out object". So I then tried declaring my timer control as Public in a module and received the same type of error.

My code was

UserControl1.RefuseTime=True

and later on I had a modlue with

Public Timer1 as Timer

and received the same type of error message as above when I tried to access the timer.

Also, how do I allow other activeX controls to access values and methods and receive events in my controls?

Ken


 
Two things I see with this. First, if you're going to raise events from your control you need to declare the variable using withevents. Like this:

Code:
Private WithEvents Timer1 As Timer

The second thing you have to do is instantiate the object. You have to say:

Code:
Set Timer1 = New Timer

The program that uses the control or DLL you're creating can use the events that are raised in your DLL or control if you expose them. Snaggs
tribesaddict@swbell.net
A procrastinator's work is never done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top