|
-
Nov 26th, 2008, 02:44 PM
#1
Thread Starter
PowerPoster
[RESOLVED] Arguments to a public sub
I have a lot of MshFlexgrids in different forms and am tired of setting the grid size to match it's rows. So I have decided to make a public sub in a bas module and just pass the grids name, but am missing something.
maybe i'm getting brain dead, but i am having trouble getting this to work
Public Sub SetGridSize(ByRef grd As MSHFlexGrid)
With grd
.Height = .Rows * .RowHeight(.Rows - 1)' use the height of the last row
End With
End Sub
I am calling it like this: In form
SetGridSize DocGrid
but am getting a "wrong arguments or invalid property assignment" message
what is wrong ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Nov 26th, 2008, 02:52 PM
#2
Re: Arguments to a public sub
add a check to make sure that .Rows is >0 before trying to use it in the formula...
-tg
-
Nov 26th, 2008, 02:59 PM
#3
Thread Starter
PowerPoster
Re: Arguments to a public sub
 Originally Posted by techgnome
add a check to make sure that .Rows is >0 before trying to use it in the formula...
-tg
I am calling it after i set the the number of rows.
In this case:
DocGrid.Rows = 6
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Nov 26th, 2008, 03:23 PM
#4
Re: Arguments to a public sub
so, what line does the error happen on?
-tg
-
Nov 26th, 2008, 03:30 PM
#5
Thread Starter
PowerPoster
Re: Arguments to a public sub
 Originally Posted by techgnome
so, what line does the error happen on?
-tg
it happens right from the call:
SetGridSize DocGrid
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Nov 26th, 2008, 03:33 PM
#6
Re: Arguments to a public sub
Have you tried stepping thru the code? Is DocGrid an MSHFlexGrid?
-
Nov 26th, 2008, 03:38 PM
#7
Re: Arguments to a public sub
Does the code work OK if this method is not in the module and rather in that form itself?
-
Nov 26th, 2008, 03:44 PM
#8
Thread Starter
PowerPoster
Re: Arguments to a public sub
 Originally Posted by dee-u
Have you tried stepping thru the code? Is DocGrid an MSHFlexGrid?
There is no stepping thru it. It happens at the call
SetGridSize DocGrid
I have also tried this: Call SetGridSize(DocGrid)
same error
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Nov 26th, 2008, 04:07 PM
#9
Thread Starter
PowerPoster
Re: Arguments to a public sub
I tried on another grid in the same project and the same error
I tried on another project and it worked, I am stumped
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Nov 27th, 2008, 08:27 AM
#10
Re: Arguments to a public sub
You seem to have missed this question:
 Originally Posted by dee-u
Is DocGrid an MSHFlexGrid?
Note that MSHFlexGrid is not the same as MSFlexGrid.
You should also check if there are any other routines called SetGridSize, as it may actually be a different one which is being called.
-
Nov 28th, 2008, 01:12 PM
#11
Thread Starter
PowerPoster
Re: Arguments to a public sub
 Originally Posted by si_the_geek
You seem to have missed this question:
Note that MSHFlexGrid is not the same as MSFlexGrid.
You should also check if there are any other routines called SetGridSize, as it may actually be a different one which is being called.
Just tried your suggestion, i thought a longshot, but
There was another SetGridSize, that was being used by an ocx
ActiveResize1_ResizeComplete. Thanks
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
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
|