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:
  1. Public Sub ControlSet(objCtrl As Object, strButton As String, intIndex As Integer)
  2. objControl = objCtrl  'object variable or  with blocked variable not set (error says)
  3. intControlIndex = intIndex

and this is the command button where the object,the string, and the index value of the arrayed command button

vb Code:
  1. Private Sub cmdFields_Click(Index As Integer)
  2. frmAddItems.ControlSet Me.cmdFields, "cmdFields", Index
  3. frmAddItems.Show vbModal
  4. 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