Results 1 to 2 of 2

Thread: passing an object to reference

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Location
    Denver, CO
    Posts
    2

    Angry passing an object to reference



    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.

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Posts
    126
    change the property from "let" to "set"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width