Code:
Private Sub cmdNew_Click()
'Check to see if all fields are filled in, avoiding Null entries
If IsNull(txtTitle) Or IsNull(boxAssigned) Or IsNull(boxRequested) Or IsNull(txtComments) Or IsNull(boxPriority) Then
MsgBox "Please ensure all fields are filled in!", , "Incomplete Form!"
Me.Undo
Else
'No Null were found, insert into table and exit after requery
CurrentDb.Execute ("INSERT INTO Table1([Title],[Assigned To],[Requested By],[Status], [Priority], [Comments]) VALUES ('" & Me.txtTitle & "', '" & Me.boxAssigned & "', '" & Me.boxRequested & "', '" & Me.boxStatus & "', '" & Me.boxPriority & "', '" & Me.txtComments & "')")
MsgBox "New repair request ticket added."
[Forms]![Main1]![lstActive].Requery
DoCmd.Close
End If
End Sub