Hi,
I've written this subroutine that modifies 2 conditional formats when the 'Finish' button is clicked to the critrea entered in the form 'Control Panel'.
This works perfectly but when the form that the conditional formats are applied to is closed and reopened the conditional formats are reset. The only way I've found to make them stay is to open the conditional formating dialog box and clicking ok.
I've written this subroutine that modifies 2 conditional formats when the 'Finish' button is clicked to the critrea entered in the form 'Control Panel'.
This works perfectly but when the form that the conditional formats are applied to is closed and reopened the conditional formats are reset. The only way I've found to make them stay is to open the conditional formating dialog box and clicking ok.
Code:
Private Sub cmdFinish_Click()
On Error GoTo Err_cmdFinish_Click
Forms![Control Panel].Refresh
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(0).Modify acFieldValue, acBetween, DLookup("[cumltotallow]", "[Control Panel]"), DLookup("[cumltotalhigh]", "[Control Panel]")
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(0).ForeColor = RGB(255, 128, 0)
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(0).FontBold = True
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(1).Modify acFieldValue, acGreaterThanOrEqual, DLookup("[cumltotalhigh]", "[Control Panel]")
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(1).ForeColor = RGB(255, 0, 0)
Forms![Switchboard].Form![Engineer Overview]![SumOfTotal].FormatConditions(1).FontBold = True
DoCmd.Save acForm, "Switchboard"
DoCmd.Close
Exit_cmdFinish_Click:
Exit Sub
Err_cmdFinish_Click:
MsgBox Err.Description
Resume Exit_cmdFinish_Click
End Sub