Thank you, Greg. You were quite right and I really shouldn't post without checking which version of code I have been testing I add to the thread.
I've hopefully taken on board your suggestions and have arrived at the following, but this still doesn't achieve my goal of the highlighted missing focus detail being removed as soon as text is input or selection is made.
Private Sub txtResearch_Change() If txtResearch.Text = vbNullString Then MsgBox "Enter Research!", vbExclamation + vbOKOnly, "Triage Hub" txtResearch.SetFocus txtResearch.BackColor = RGB(255, 255, 204) GoTo lbl_Exit End If lbl_Exit: Exit Sub End Sub Private Sub cbThreat_Change() If cbThreat.ListIndex < 1 Then MsgBox "Select threat level!", vbExclamation + vbOKOnly, "Triage Hub" cbThreat.SetFocus cbThreat.BackColor = RGB(102, 255, 255) GoTo lbl_Exit End If lbl_Exit: Exit Sub End Sub Private Sub EnterBut_Click() txtResearch_Change If txtResearch.Text < " " Then txtResearch.BackColor = RGB(255, 255, 204) GoTo lbl_Exit End If cbThreat_Change If cbThreat.ListIndex < 1 Then cbThreat.BackColor = RGB(255, 255, 204) GoTo lbl_Exit End If Tag = 1 Hide lbl_Exit: Exit Sub End Sub




Reply With Quote