There are a few fields in my form I want make sure a user has filled in (but I don't want to make them 'required' since that causes confusion and unnecessary questions if users click on and off a field or erase some data and click off or whatever).
Behind my submit button I have this
Code:
Private Sub btnSubmit_Click()
If Me.DateEntry.Value = Null Or Me.cboDefect.Value = Null Or Me.cboCommodity.Value = Null Or Me.txtPartNumber_PK.Value = Null Or Me.cboShift.Value = Null Or Me.txtSupplier.Value = Null Then
MsgBox "Please ensure all applicable fields are filled in.", vbExclamation + vbOKOnly, "Missing Information"
Else: DoCmd.GoToRecord , , acNewRec
End If
End Sub
I want the message box to appear if the user has the specified fields blank. But this doesn't happen and the acNewRec proceeds anyways. I tried having all the cbos and txts listed as .Value = "" but it didn't work either.
Thanks in advance.