
Originally Posted by
markjkubicki
I have a subform with a couple command buttons in the form footer. One of the controls is a toggle button that simply changes the backcolor of the form's detail section (as way for the user to remind themselves that the information in the detail entries may need some addtional work / editing / entries / etc.)
The problem is that when there are no entries in the detail section, clicking the contol, adds an entry. Although the entry is blank, it is unnecessary, and causes problems later on.
Is there a line of code that I can add to allow the procedure to execute without adding the blank entry to the subform's data source?
Const NormalColor As Long = -2147483643
Const FlagColor As Long = 9434879
Private Sub tglInstallationNoteFlag_Click()
If Me.tglInstallationNoteFlag = False Then
Me.Detail.BackColor = NormalColor
Else
Me.Detail.BackColor = FlagColor
End If
End Sub
thanks in advance,
mark