PDA

Click to See Complete Forum and Search --> : passing an object to reference


jam05143
Nov 23rd, 2002, 05:58 PM
:confused:

I'm trying to do this exactly:

ActiveX control:

Private m_TargetObject As Object

Public Property Let TargetObject (ByRef New_TargetObject As Object)

Set m_TargetObject = New_Target

End Property

Compile The Controll . . .

Standard Exe:

Private Sub Command1_Click()

UserControl.TargetObject = Form2 'This one works

End Sub

Private Sub Command2_Click()

UserControl.TargetObject = Picture1 'This one does not work

End Sub

Why can I pass a form by reference to the control, but not any other types of controls? I get RunTime Error 450: Invalid number of arguments or invalid property assignment.

deja
Nov 24th, 2002, 12:02 AM
change the property from "let" to "set"