I have a form with the below ON CURRENT event.
It works. However, I wonder if there is better coding to do?
Could you tell me if there is a better way?
I have 3 possible txtTripModeName's.
Based on a name, I have the field in the form changing background and foreground colors. This helps me see the kind of record faster. I am color oriented. Thanks for looking.
This all works but want a better mouse trap.
Cimoli.
Private Sub Form_Current()
If txtTripModeName = "Bus Line Run" Then
txtTripModeName.BackColor = 255 'red
txtTripModeName.ForeColor = 16777215 'white
End If
If txtTripModeName = "Bus Charter" Then
txtTripModeName.BackColor = 65534 'yellow
txtTripModeName.ForeColor = 0 'black
End If
If txtTripModeName = "Air Plane" Then
txtTripModeName.BackColor = 15401600 'purple
txtTripModeName.ForeColor = 16777215 'white
End If
End Sub
It works. However, I wonder if there is better coding to do?
Could you tell me if there is a better way?
I have 3 possible txtTripModeName's.
Based on a name, I have the field in the form changing background and foreground colors. This helps me see the kind of record faster. I am color oriented. Thanks for looking.
This all works but want a better mouse trap.
Cimoli.
Private Sub Form_Current()
If txtTripModeName = "Bus Line Run" Then
txtTripModeName.BackColor = 255 'red
txtTripModeName.ForeColor = 16777215 'white
End If
If txtTripModeName = "Bus Charter" Then
txtTripModeName.BackColor = 65534 'yellow
txtTripModeName.ForeColor = 0 'black
End If
If txtTripModeName = "Air Plane" Then
txtTripModeName.BackColor = 15401600 'purple
txtTripModeName.ForeColor = 16777215 'white
End If
End Sub