Link to home
Create AccountLog in
Avatar of TechLad
TechLadFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Text box Validation

Hi,
Can anyone suggest a better way of displaying an msgbox when there is no text in several text boxes and displaying which textbox has no data in it?

So far I come up with this which does its job, however I want to display a different message for each missing section.

This code displays the same message for everything.

This is what I’ve come up with so far.

Private Sub CommandSave_Click

‘Trying to display different message for each of these missing textboxes

If mIssueID.Text = "" Or mTaskTitle.Text = "" Or mCode.Text = "" Or mDescription.Text = "" Or mOperatorName.Text = "" Then

MsgBox "Please Fill the Sections ", vbExclamation, "Sections Missing"

Else

Adodc1.Recordset.Update

MsgBox "New issue added", vbInformation, "Confirmation"

End If
End Sub
ASKER CERTIFIED SOLUTION
Avatar of plusone3055
plusone3055
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of TechLad

ASKER

Vb6 ? elseif highlighted in red
SOLUTION
Avatar of Ian Pattison
Ian Pattison
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account