Does anybody know how to validate combo boxes because i cant seem to get this code to work
Dim response As String
Dim response2 As String
Dim Response3 As String
Dim response4 As String
Dim response5 As String
If (IsNull(DateId)) Or DateId = "" Then
response = MsgBox("Date field is empty, Please Select a date", vbOKOnly, Error)
Exit Sub
ElseIf (IsNull(PlantId)) Then
response2 = MsgBox("Plant Code field is empty, Please Select a Code", vbOKOnly, Error)
Exit Sub
ElseIf (IsNull(ShiftTypeId)) Then
Response3 = MsgBox("Shift Type field is empty, Please Select a Shift Type", vbOKOnly, Error)
Exit Sub
ElseIf TotalShiftLength = 0 Or (IsNull(TotalShiftLength)) Then
response4 = MsgBox("Shift Length field is empty, Please add a Shift Length", vbOKOnly, Error)
Exit Sub
End If
response5 = MsgBox("Save Completed", vbOKOnly, "Confirmation")
DoCmd.GoToRecord , , acNewRec
Dim response As String
Dim response2 As String
Dim Response3 As String
Dim response4 As String
Dim response5 As String
If (IsNull(DateId)) Or DateId = "" Then
response = MsgBox("Date field is empty, Please Select a date", vbOKOnly, Error)
Exit Sub
ElseIf (IsNull(PlantId)) Then
response2 = MsgBox("Plant Code field is empty, Please Select a Code", vbOKOnly, Error)
Exit Sub
ElseIf (IsNull(ShiftTypeId)) Then
Response3 = MsgBox("Shift Type field is empty, Please Select a Shift Type", vbOKOnly, Error)
Exit Sub
ElseIf TotalShiftLength = 0 Or (IsNull(TotalShiftLength)) Then
response4 = MsgBox("Shift Length field is empty, Please add a Shift Length", vbOKOnly, Error)
Exit Sub
End If
response5 = MsgBox("Save Completed", vbOKOnly, "Confirmation")
DoCmd.GoToRecord , , acNewRec