G
Guest
I would like to change the color of my text based on certain conditions.
Right now my code looks like this
Private Sub Description_AfterUpdate()
If Line = "JS" And Description = "Bonder" And Workstation = "Workstation #4"
Then
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"
If the above conditions are true I would like to still get my message box
and then change the color of the text that appears in "Line" "Description"
and "Workstation" to "Red". I only want to do this for records that meet
this criteria. When I change the color now it changes the color of all
records. I have about 30 conditions so I don't think I can use "Conditional
Formatting". I've looked at code examples but none of them seem to work for
me. Below are more examples of my conditions. Thanks for your help.
ElseIf Line = "JS" And Description = "FLA" And Workstation = "Workstation
#9" Then Line.ForeColor = lngRed: Workstation.ForeColor = 255:
Description.ForeColor = 255
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"
ElseIf Line = "968 Rear" And Description = "Welder" And Workstation =
"Workstation #3" Then
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"
Right now my code looks like this
Private Sub Description_AfterUpdate()
If Line = "JS" And Description = "Bonder" And Workstation = "Workstation #4"
Then
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"
If the above conditions are true I would like to still get my message box
and then change the color of the text that appears in "Line" "Description"
and "Workstation" to "Red". I only want to do this for records that meet
this criteria. When I change the color now it changes the color of all
records. I have about 30 conditions so I don't think I can use "Conditional
Formatting". I've looked at code examples but none of them seem to work for
me. Below are more examples of my conditions. Thanks for your help.
ElseIf Line = "JS" And Description = "FLA" And Workstation = "Workstation
#9" Then Line.ForeColor = lngRed: Workstation.ForeColor = 255:
Description.ForeColor = 255
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"
ElseIf Line = "968 Rear" And Description = "Welder" And Workstation =
"Workstation #3" Then
MsgBox "OPERATOR MUST MEET QUANDRANT 3 OR ABOVE STANDARDS TO OPERATE THIS
STATION. FOR THE PURPOSES OF TRAINING AN OPERATOR TO MEET THIS STANDARD, THE
TRAINEE MUST WORK WITH A QUALIFIED QUADRANT 3 OPERATOR OR SUPERVISOR FOR A
MININUM OF 30 MINUTES. AS WELL, THE SUPERVISOR MUST ACKNOWLEDGE THE ABILITY
OF THE TRAINEE TO MEET THE QUADRANT 3 QUALIFICATIONS"