Autonumber adding on when not saving record
The problem im having is that the autonumber is advancing even if the user doesnt save the record...
e.g. if they begin creating then cancel
this is a problem as the next time they go to use it, it will be out of sync
Thats my code on the save button if it helps
Thanks for any help im very confused and feel like :banghead:.
The problem im having is that the autonumber is advancing even if the user doesnt save the record...
e.g. if they begin creating then cancel
this is a problem as the next time they go to use it, it will be out of sync
Code:
Private Sub Command34_Click()
Dim stDocName As String
If IsNull(Me.Engineer1) And Me.Engineer2 & "" <> "" Then
MsgBox "You Must enter Engineer 1 before you enter Engineer 2", vbExclamation, "Visit Report"
Exit Sub
ElseIf IsNull(Me.Engineer2) And Me.Engineer3 & "" <> "" Then
MsgBox "You Must enter Engineer 2 before you enter Engineer 3", vbExclamation, "Visit Report"
Exit Sub
ElseIf IsNull(Me.Engineer1) And Me.Engineer3 & "" <> "" Then
MsgBox "You Must enter Engineer 1 before you enter Engineer 3", vbExclamation, "Visit Report"
Exit Sub
End If
If IsNull(Me.Text38) Or IsNull(Me.cbrQuoteNum) Or IsNull(Me.TypeOfWorks) Or IsNull(Me.Engineer1) Or IsNull(Me.Customer) Then
MsgBox "You have not completed all of the required fields!", vbExclamation, "Visit Report"
Exit Sub
End If
If MsgBox("Do you want to add another Visit sheet?", vbYesNo, "Additional") = vbYes Then
DoCmd.RunCommand acCmdSaveRecord
stDocName = "Visit Form"
DoCmd.OpenForm stDocName, , , acFormAdd
Else
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
DoCmd.OpenForm "HomePage"
End If
End Sub
Thats my code on the save button if it helps
Thanks for any help im very confused and feel like :banghead:.
Last edited: