Conditional Format Form within a Form

mattloflin

Question Askin Lad
Local time
Today, 13:29
Joined
Dec 22, 2007
Messages
31
Conditional Format Subform

Hey guys i'm kind of confused. I'm new to access but I've been getting a lot of progress.

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:

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


I tried making this on the frmSearch under Public ConditionalFormat() <- my own public sub and call for it when they click the search button so the results are formatted.

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!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom