|
-
May 30th, 2008, 07:47 PM
#1
Thread Starter
Addicted Member
[RESOLVED] passing objects on a sub-procedure
hi guys, I am making this program where I need to pass the name of the control( or the control) to a sub-procedure, the sub procedure is made inside the another form and I am using it to set the visibility etc. on the second form ( i.e. I pressed this command1(0), on the click event i will set first the visible and locked control on the second form before showing the second form)
I am using an active x control arrayed command button, but I'm having a problem doing this. This is the code and the error says
vb Code:
Public Sub ControlSet(objCtrl As Object, strButton As String, intIndex As Integer) objControl = objCtrl 'object variable or with blocked variable not set (error says) intControlIndex = intIndex
and this is the command button where the object,the string, and the index value of the arrayed command button
vb Code:
Private Sub cmdFields_Click(Index As Integer) frmAddItems.ControlSet Me.cmdFields, "cmdFields", Index frmAddItems.Show vbModal End Sub
I have seen a statement that passes an object/control on a sub procedure , but I am not sure how to do it in a arrayed active x ( or maybe I am just confused)
can someone give me a hand on this?..
thanks..
kyle
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|