I have a form FRMDATABASE that is loaded into FRMSEARCH and frm search has a bunch of txtboxes that searches the the FRMDATABASE but now I need to conditional format the data within the FRMDATABASE and I have to do it based of code sense I can't limit it to 3.
I use this on the report of the searched criteria and it works like a charm:
Expand|Select|Wrap|Line Numbers
- If [Description] Like "*" & "Print Not Available" & "*" Then
- [Description].BackColor = &H51A8FF
- [Description].FontBold = True
- [Description].ForeColor = vbBlack
- ElseIf [Description] Like "*" & "In Production" & "*" Then
- [Description].BackColor = vbYellow
- [Description].FontBold = True
- [Description].ForeColor = vbBlack
- Else
- [Description].BackColor = vbWhite
- [Description].FontBold = False
- [Description].ForeColor = vbBlack
- End If
- If [General Notes] = "*" & "Ready to Ship on Rack" & "*" Then
- [General Notes].BackColor = &HA8ACFF
- [General Notes].FontBold = True
- [General Notes].ForeColor = vbBlack
- ElseIf [General Notes] Like "*" & "Need Test Sheet" & "*" Then
- [General Notes].BackColor = &HFFFF00
- [General Notes].FontBold = True
- [General Notes].ForeColor = vbBlack
- ElseIf [General Notes] Like "*" & "Error" & "*" Then
- [General Notes].BackColor = vbRed
- [General Notes].FontBold = True
- [General Notes].ForeColor = vbWhite
- ElseIf [General Notes] Like "*" & "Order on Hold" & "*" Then
- [General Notes].BackColor = vbRed
- [General Notes].FontBold = True
- [General Notes].ForeColor = vbWhite
- Else
- [General Notes].BackColor = vbWhite
- [General Notes].FontBold = False
- [General Notes].ForeColor = vbBlack
- End If
It pups up errors and stuff.
Also FRMDatabase is based of a query qryDatabase which is based of the main table tblDatabase.
Thanks in Advance!