passing a control to a sub

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
 
J

Jack Leach

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top