passing a control to a sub

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

I'm having trouble passing a MSFlexGrid control to a sub. The control name
is "flxGalleries". The error is "Type Mismatch. Error '13'". I have the
following code:

Private Sub Form_Open (Cancel as Integer)
.... do stuff ...
GridSetup flxGalleries 'Call the Sub and pass the Control
.... do more stuff ...
End Sub

Public Sub GridSetup (ByRef flxGrid As MSFlexGrid)
With flxGrid
.... do stuff ...
End With
End Sub

What have I done wrong?

Cheers
 
Maybe try the following syntax to call it:


GridSetup Me.flxGalleries

or

GridSetup Me.Controls("flxGalleries")




hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top