dim AdoRs as new adodb.Recordset
adors.open "select ....",cnn,adOpenForwardOnly
set MSHFlexGrid1.datasouce = adors
adors.close :set adors =nothing
With MSHFlexGrid1
Dim i As Integer
For i = 1 To .rows -1
.Row = 3
.Col = i
if ... = true then
.CellBackColor = vbRed
end if
Next
End With
Private Sub Form_Load()
With MSHFlexGrid1
.Rows = 5
.Cols = 9
Dim i As Integer
For i = 0 To 8
.Row = 3
.Col = i
.CellBackColor = vbRed
Next
End With
End Sub