I'm trying to get the backcolor on a field to change in response to an entry on another field. I have [Date_Submitted] set to change to red when [Submitter} is "Stephen Black", else [Date_Submitted] is green. (This may not make sense, but I don't have the db I'm going to use this on ready, so I'm trying to sort this out on an old db.) I'm using:
Private Sub Form_Timer()
If Me.[Submitter] = "Black, Stephen" Then
Me.Date_Submitted.BackColor = 255
Else: Me.Date_Submitted.BackColor = 8421376
End If
End Sub
This works fine. What I would like to do though is for the code to read a table instead of just "text". This would make it easier on my to add to the list of names that meet the condition. Can I get some help on how I should replace "Black, Stephen" with a table? Also, further down the road, I'd like to be able to identify "Hot Words" in a freeform text or memo field. Right now what I'm using can only identify the condition if the condition is meet exactly. I'd like to have the condition met if a specific word in a paragraph is entered. If the hotword were "picnic", I would like the condition met in sentences such as "The company picnic is July 29" and "The company picnic has been postponed until August 29". Any suggestions?
TIA
Private Sub Form_Timer()
If Me.[Submitter] = "Black, Stephen" Then
Me.Date_Submitted.BackColor = 255
Else: Me.Date_Submitted.BackColor = 8421376
End If
End Sub
This works fine. What I would like to do though is for the code to read a table instead of just "text". This would make it easier on my to add to the list of names that meet the condition. Can I get some help on how I should replace "Black, Stephen" with a table? Also, further down the road, I'd like to be able to identify "Hot Words" in a freeform text or memo field. Right now what I'm using can only identify the condition if the condition is meet exactly. I'd like to have the condition met if a specific word in a paragraph is entered. If the hotword were "picnic", I would like the condition met in sentences such as "The company picnic is July 29" and "The company picnic has been postponed until August 29". Any suggestions?
TIA