Hi.
I have a form with numerous text boxes for a data capture solution which has 11 textfields, 3 auto populated, 7 for mandatory replies and 1 for an optional response.
This app works well but I'm wondering if there's a better solution for error trapping blank fields rather than this...
Any ideas? I'm happy with the functionality, but it looks a bit messy as outside of the textboxes, there's also a number of Combo boxes and check boxes that are being trapped in a similar way, and feeding back to a caption label on the capture form.
Cheers,
Jon
I have a form with numerous text boxes for a data capture solution which has 11 textfields, 3 auto populated, 7 for mandatory replies and 1 for an optional response.
This app works well but I'm wondering if there's a better solution for error trapping blank fields rather than this...
Code:
If txtLogDate.Value = "" Then lblMessage.Caption = "Please Enter Date": Exit Sub
If txtItem.Value = "" Then lblMessage.Caption = "Please Enter Item Number": Exit Sub
If txtCaption.Value = "" Then lblMessage.Caption = "Please Enter A Caption": Exit Sub
If txtObserve.Value = "" Then lblMessage.Caption = "Please Enter Observations": Exit Sub
If txtObsRec.Value = "" Then lblMessage.Caption = "Please Enter Recommendations": Exit Sub
If txtDeadLine.Value = "" Then lblMessage.Caption = "Please Set Deadline": Exit Sub
If txtManResp.Value = "" Then lblMessage.Caption = "Please Enter A Response": Exit Sub
Any ideas? I'm happy with the functionality, but it looks a bit messy as outside of the textboxes, there's also a number of Combo boxes and check boxes that are being trapped in a similar way, and feeding back to a caption label on the capture form.
Cheers,
Jon