View Single Post
  #6 (permalink)  
Old February 3rd, 2004, 02:51 PM
marcostraf marcostraf is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is a bad idea to assume that the global procedure knows the name of the grid in the form you are passing. As you wrote, it works only if the form has a grid named 'Flex'.
Much safer to pass the grid itself:

Public sub DoGrid(grd as MSFlexGrid, ...)

and call it from your form with:

DoGrid Me.NameOfTheGrid

In this way you can reuse you main code and any form can rename their grids as needed without breaking the code.

Marco


Quote:
quote:Originally posted by mike123abc
 OK, I tried it and it works ("theForm" variable of DoSomething... defined as type "object").

You can then reference it (theForm.Flex.Row... ) from within the function and change the calling form or the objects it contains.

Thanks


Reply With Quote