Access VBA IF Statement Multiple Criteria
I am attempting to create an if statement with multiple variables. I have a form that user will fill out but I do not want them to be able to save any information if any number of the three controls are left blank.
Code:
Private Sub cmdSave_Click()
On Error GoTo HandleError
If me.txtdate.value <> "" And Me.cboShift.Value <> "" And me.cboSection.value <> = "" Then
intResponse = MsgBox("Are you sure you want to save the shift summary information " & Me.cboShift And "shift - " & me.cboSection & " for " & Me.txtDate & ".", vbYesNo)
Else
'Call CheckMaintanceSchedule
If lngShiftSummary = 0 then
Else
MsgBox "A date, shift, and section must be provided in order to save the shift summary information on the form. Please provide this information.", vbOKOnly
Me.txtDate.SetFocus
End If
HandleError:
If Err.Number <> 0 Then
GeneralErrorHandler Err.Number, Err.Description, SHIFT_SUMMARY_DETAILS_FORM, "cmdSave_Click"
End If
End Sub
The code appears to runs through the IF statement fine but then skips the "intResponse line and immediately jumps to the Handle error code. Does anyone have any suggestions?