الى حين تجهيز المرفق الفكرة كالتالي
عندي جدول للعملات اريد استخدامها في جدول الحركة اليومية تمام
ساقوم بتصميم نموذج استعراض بيانات الحركة اليومية يجب ان يكون حقل العملة ملون حسب اللون المحدد في جدول العملات
وجدت هذا الكود على النت لكن الشرط يقبل قيمة عددية ولا يقبل قيمة نصية
Dim objFrc As FormatCondition
Dim lngRed As Long
Dim lngWhite As Long
Dim lngBlack As Long
Dim lngYellow As Long
Dim lngBlue As Long
Dim lngGreen As Long
lngRed = RGB(255, 0, 0)
lngWhite = RGB(255, 255, 255)
lngBlack = RGB(0, 0, 0)
lngYellow = RGB(255, 255, 0)
lngBlue = RGB(0, 0, 255)
lngGreen = RGB(0, 255, 0)
Me![inCoinName].FormatConditions.Delete
Set objFrc = Me![inCoinName].FormatConditions.add(acFieldValue, acEqual)
Set objFrc = Me![inCoinName].FormatConditions.add(acFieldValue, acEqual, "ليرة")
Set objFrc = Me![inCoinName].FormatConditions.add(acFieldValue, acEqual, 500)
With Me![inCoinName].FormatConditions(0)
.BackColor = lngYellow
.FontBold = True
.ForeColor = lngRed
End With
With Me![inCoinName].FormatConditions(1)
.BackColor = lngBlue
.FontBold = True
.ForeColor = lngWhite
End With
With Me![inCoinName].FormatConditions(2)
.BackColor = lngGreen
.FontBold = True
.ForeColor = lngBlack
End With