Sinsitrus
Messages postés849Date d'inscriptionsamedi 11 juin 2005StatutMembreDernière intervention21 août 2015
-
Modifié par Sinsitrus le 3/08/2014 à 18:07
leraymond
Messages postés2Date d'inscriptionsamedi 12 juillet 2014StatutMembreDernière intervention14 septembre 2014
-
14 sept. 2014 à 12:00
Bonjour à tous !
J'utilise ce code pour afficher ma table :
Dim J As Integer
Set BAZ = New clsADO
BAZ.DBConnect App.Path & "\al_jabr_group.ajgb"
BAZ.RSExecute "SELECT * FROM tb_Rapport_General;"
Data.DatabaseName = App.Path & "\Al_Jabr_Group.ajgb"
Data.RecordSource = "tb_Rapport_General"
Data.Refresh
J = 0
If Not (Data.Recordset.BOF And Data.Recordset.EOF) Then
Data.Recordset.MoveLast
Data.Recordset.MoveFirst
MSFGrid.Rows = Data.Recordset.RecordCount + 1
J = 1
Do While Not Data.Recordset.EOF
MSFGrid.TextMatrix(J, 0) = Format(Data.Recordset!Matricule, "000000")
MSFGrid.TextMatrix(J, 1) = Data.Recordset!Employe
MSFGrid.TextMatrix(J, 2) = Format(Data.Recordset!SalaireBrut, "Standard")
MSFGrid.TextMatrix(J, 3) = Format(Data.Recordset!Avantage, "Standard")
MSFGrid.TextMatrix(J, 4) = Format(Data.Recordset!Transport, "Standard")
MSFGrid.TextMatrix(J, 5) = Format(Data.Recordset!Telephone, "Standard")
MSFGrid.TextMatrix(J, 6) = Format(Data.Recordset!Accompte, "Standard")
MSFGrid.TextMatrix(J, 7) = Format(Data.Recordset!SalaireNet, "Standard")
MSFGrid.TextMatrix(J, 8) = Format(Data.Recordset!Pret, "Standard")
J = J + 1
Data.Recordset.MoveNext
Loop
End If
Je souhaiterais que là où la valeur de
MSFGrid.TextMatrix(J, 8) est > 0
, la ligne entière se colorie en rouge.
Pouvez-vous m'aider svp ?
Merci
----------
OS : Windows 7 Pro 64 Bit
Platforme : Visual Basic 6.0
Après avoir changé mon code, je me retrouve avec la dernière ligne colorée... je n'arrives pas à faire le tour du tableau :
Dim J As Integer
Dim Ligne As Integer
Dim Colonne As Integer
Set BAZ = New clsADO
BAZ.DBConnect App.Path & "\al_jabr_group.ajgb"
BAZ.RSExecute "SELECT * FROM tb_Rapport_General;"
Data.DatabaseName = App.Path & "\Al_Jabr_Group.ajgb"
Data.RecordSource = "tb_Rapport_General"
Data.Refresh
'---------------------------------------------------------
J = 0
If Not (Data.Recordset.BOF And Data.Recordset.EOF) Then
Data.Recordset.MoveLast
Data.Recordset.MoveFirst
MSFGrid.Rows = Data.Recordset.RecordCount + 1
J = 1
Do While Not Data.Recordset.EOF
MSFGrid.TextMatrix(J, 0) = Format(Data.Recordset!Matricule, "000000")
MSFGrid.TextMatrix(J, 1) = Data.Recordset!Employe
MSFGrid.TextMatrix(J, 2) = Format(Data.Recordset!SalaireBrut, "Standard")
MSFGrid.TextMatrix(J, 3) = Format(Data.Recordset!Avantage, "Standard")
MSFGrid.TextMatrix(J, 4) = Format(Data.Recordset!Transport, "Standard")
MSFGrid.TextMatrix(J, 5) = Format(Data.Recordset!Telephone, "Standard")
MSFGrid.TextMatrix(J, 6) = Format(Data.Recordset!Accompte, "Standard")
MSFGrid.TextMatrix(J, 7) = Format(Data.Recordset!SalaireNet, "Standard")
MSFGrid.TextMatrix(J, 8) = Format(Data.Recordset!Pret, "Standard")
'-----------------------------------------------
For Ligne = 1 To MSFGrid.Rows - 1
MSFGrid.Row = Ligne
If Ligne Mod 2 = 0 Then
For Colonne = 0 To MSFGrid.Cols - 1
MSFGrid.Col = Colonne
MSFGrid.CellBackColor = RGB(226, 243, 245)
Next Colonne
End If
Next Ligne
MSFGrid.Row = J
If MSFGrid.TextMatrix(J, 8) > 0 Then
For Colonne = 0 To MSFGrid.Cols - 1
MSFGrid.Col = Colonne
MSFGrid.CellBackColor = RGB(244, 207, 206)
Next Colonne
End If
'-----------------------------------------------
J = J + 1
Data.Recordset.MoveNext
Loop
End If