I've got this code from searching through the threads here, but when I use it, the relevant messageboxes pop up, great, but then the form wont go to the next record....it just remains stationary.
Any ideas? I think my Else's and my Endifs are in the wrong place. I've been pulling my hair out over this, any help would be greatly appreciated
(I took the error handlers out for now to make things easier - I'll put them back in once I've clocked the coding
)
Any ideas? I think my Else's and my Endifs are in the wrong place. I've been pulling my hair out over this, any help would be greatly appreciated

(I took the error handlers out for now to make things easier - I'll put them back in once I've clocked the coding

Code:
Private Sub cmdAddRecord_Click()
If Me.Status.Value = "Closed" Then
If Me.P_Ref.Value & "" = "" Then
Cancel = True
MsgBox "Please ensure the P Ref field is complete", vbInformation
End If
If Me.No_Users_Reported_Affected.Value & "" = "" Then
Cancel = True
MsgBox "Please ensure the No Users Reported Affected field is complete", vbInformation
End If
If Me.Date_Time_Resolved.Value & "" = "" Then
Cancel = True
MsgBox "Please ensure the Date Time Resolved field is complete", vbInformation
End If
Else
DoCmd.GoToRecord , , acNewRec
End If
End Sub
Last edited: