PDA

View Full Version : [SOLVED:] MsgBox with Icon on error



HTSCF Fareha
08-11-2020, 02:28 AM
Trying to get the Critical icon to show in the message box if a text is not input.


If TextBox2.Index = 0 Then
OutPut = MsgBox("Provide reason", vbCritical, "Audit Department")
TextBox2.SetFocus
Exit Sub
End If

I don't think I'm too far away, but not quite there.

Thanks!

gmayor
08-11-2020, 02:43 AM
If TextBox2.Text = "" Then
MsgBox "Provide reason", vbCritical, "Audit Department"
TextBox2.SetFocus
Exit Sub
End if

HTSCF Fareha
08-11-2020, 11:24 PM
Thank you, this works nicely.