|
แก้ไขครั้งสุดท้ายโดย my2alee เมื่อ 2019-12-18 16:04
fgData.Rows = RS.RecordCount + 1
lblCount.Caption = "จำนวน : " & RS.RecordCount & " รายการ"
If blnSearch = True And RS.RecordCount > 0 Then
lblCountData.Caption = "ผลการค้าหา : " & RS.RecordCount & " รายการ"
End If
RS.MoveFirst
item = 1
Do Until RS.EOF
With fgData
.TextMatrix(item, 0) = RS("new_id")
.TextMatrix(item, 1) = item
.TextMatrix(item, 2) = "" & RS("hn")
.TextMatrix(item, 3) = "" & RS("full_name")
.TextMatrix(item, 4) = "" & RS("q_no")
.TextMatrix(item, 5) = "" & Right(RS("q_time"), 8)
If RS("status_call") = "0" Then
strStatusCall = "ยังไม่เรียกคิว"
ElseIf RS("status_call") = "1" Then
strStatusCall = "เรียกแล้ว"
ElseIf RS("status_call") = "2" Then
strStatusCall = "เรียกแล้ว-ไม่มา"
End If
.TextMatrix(item, 6) = "" & strStatusCall
'แสดงสี*** ตามเงื่อนไข
If RS("status_call") = "0" Then 'Hilite new row in red
.Col = 6
.Row = item
.CellBackColor = vbRed
.CellFontBold = True
ElseIf RS("status_call") = "1" Then 'Hilite new row in red
.Col = 6
.Row = item
.CellBackColor = vbGreen
.CellFontBold = True
ElseIf RS("status_call") = "2" Then 'Hilite new row in red
.Col = 6
.Row = item
.CellBackColor = vbYellow
.CellFontBold = True
End If
'********************
End With
item = item + 1
RS.MoveNext
Loop
ผมแนบรูปมาให้ด้วยครับ ตอนนี้ผมทำได้แค่กำหนดตำแหน่ง Col ไป (จากรูปคือ Col 6)
อยากให้มันเปลี่ยนสีตามเงื่อนไขทั้งแถวเลยครับ
|
-
|