July 27th, 1999, 01:22 AM
I have created a usercontrol which has a Function Display which simply returns a string. I could instantiate the Activex control by using the following code
Dim ctrl As Control
Dim str As String
Set ctrl = Me.Controls.Add("DispProj.DispControl", "Dispproj")
ctrl.Visible = True
str = ctrl.Display ' this line gives the error-438
But when I try to call the Display method I am getting a Runtime Error-438
(ErrDescription:The object doesn't support this method or property). Then
I tried to call Display method by using the "CallByName" function, but it didn't work.
Finally I attemped to create the Control Dynamically by using the CreateObject function. CreateObject is creating the instance of the object but it is not showing the control on the form. But surprisingly I could call the Display method.
Please help me.
Dim ctrl As Control
Dim str As String
Set ctrl = Me.Controls.Add("DispProj.DispControl", "Dispproj")
ctrl.Visible = True
str = ctrl.Display ' this line gives the error-438
But when I try to call the Display method I am getting a Runtime Error-438
(ErrDescription:The object doesn't support this method or property). Then
I tried to call Display method by using the "CallByName" function, but it didn't work.
Finally I attemped to create the Control Dynamically by using the CreateObject function. CreateObject is creating the instance of the object but it is not showing the control on the form. But surprisingly I could call the Display method.
Please help me.