Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modify an object.
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00362257
Message ID:
00362280
Views:
22
>I have a number of grids that I desire to visualy modify via a function. And I get the type mismatch error when using the code below. I know I am overlooking something simple. I appreciate everyones help.
>
>
>Private Sub CmdTestGreenBar_Click()
>    GreenBar (frmMain.grdBudgetSummary)
>End Sub
>'====================
>Public Function GreenBar(objGrid As Object)
>    Dim x As Long
>    objGrid.Row = 0
>    objGrid.Col = 0
>
>    Do Until objGrid.Row = objGrid.Rows - 1
>        objGrid.Row = objGrid.Row + 1
>
>        For x = 0 To objGrid.Cols - 1
>            objGrid.Col = x
>            objGrid.CellBackColor = &HC0FFC0 'Light green
>        Next
>        objGrid.Row = objGrid.Row + 1
>    Loop
>' DEV: fix for odd number of rows
>End Function
Which grid control are you using?

Try a simple thing, don't put parentheses around the the paramater:
GreenBar frmMain.grdBudgetSummary
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform