I'd like to run 3 specific MSHFlexGrids through a for/next loop, but i don't know how to reference them correctly. Below is an example of what I am trying to do:
The code above chokes on "cControl = Me.flxFindPhones". Any other ideas out there?Code:Dim cControl as MSHFlexGrid For i = 1 To 3 If i = 1 Then cControl = Me.flxFindPhones ElseIf i = 2 Then cControl = Me.flxViewPhones ElseIf i = 3 Then cControl = Me.flxEditPhones End If With cControl .TextMatrix(0, 0) = "Type" .TextMatrix(0, 1) = "Number" .Row = 0 For j = 0 To 1 .Col = j .CellAlignment = flexAlignLeftCenter Next j .ColWidth(0) = 1920 .ColAlignment(0) = flexAlignLeftCenter .ColWidth(1) = 2835 .ColAlignment(1) = flexAlignLeftCenter End With Next i
Thanks,
Jeff




Reply With Quote