I have 2 if statements. The first is to add a new record. It will give the message I put into it, but won't go to a new record. Here's the code:
Private Sub btnAdd_Click()
If IsNull(cboEquipTypeID) And IsNull(EquipID) Then
MsgBox "You need to choose a type"
ElseIf (cboSerialNo = 0) And IsNull(QuantityOut) Then
MsgBox "Enter a quantity"
ElseIf (cboSerialNo) Then
DoCmd.GoToRecord , "", acNewRec
End If
End Sub
The second code also gives the message I put into it, but won't close the form. Here's the code:
Private Sub btnSave_Click()
If IsNull(cboEquipTypeID) And IsNull(EquipID) Then
MsgBox "You need to choose a type"
ElseIf (cboSerialNo = 0) And IsNull(QuantityOut) Then
MsgBox "Enter a quantity"
ElseIf (cboSerialNo) Then
DoCmd.OpenQuery "qryIssueEquipUpdate"
Me.IssuedByID.Value = Forms!frmMainMenu.txtUserID
DoCmd.Close
End If
End Sub
I'm not sure what I did wrong.