Private Sub chkRed_AfterUpdate()
If Me.chkRed = True Then
If InStr(txtColor, "Red") = False Then
txtColor= txtColor & "Red, "
End If
ElseIf Me.chkRed = False Then
If InStr(txtColor, "Red") = True Then
' somehow remove the word "red" from txtColor
End If
End If
End Sub
Private Sub chkRed_AfterUpdate()
If Me.chkRed = True Then
If InStr(txtColor, "Red") = False Then
txtColor = txtColor & "Red, "
End If
ElseIf Me.chkRed = False Then
If InStr(txtColor, "Red, ") = True Then
txtColor = txtColor & Replace(txtColor, "Red, ", "")
End If
End If
End Sub
[COLOR=red]Replace([/COLOR]"Green, Blue, Red, Yellow, Black, Purple"[COLOR=red], [/COLOR]"Red, "[COLOR=red],[/COLOR] ""[COLOR=red])[/COLOR]
If InStr(txtColor, "Red") = True Then
' do nothing
Else
txtColor = Replace(txtColor, "Red, ", "")
End If