I have posted this concern before, but I was mis-understanding what was causing it...in actuality, I don't know what's causing it, which is why I'm posting the question here.
Whenever any users enter data into the main table via a form based on the table (not on a query of the table), a blank record is inserted after the current record so that if you navigate to the final record, it is not the one you just entered, but a totally blank one.
I can tell these are just accidental blank records, because the one field with a default value (a Yes/No field with a Yes; No Value List) displays a -1 (since "Yes" is the default value), where all the others display "yes" or "no".
This is the only code attached to the form itself (note: "current info" is the field mentioned above):
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Date modified
Me!ContactInfoModifiedBy = CurrentUser()
Me!ContactDateModified = Now()
If Me.CurrentInfo = "No" Or Me.chkBlacklisted = -1 Then
Me.CourseCatalog = 0
Me.OmitFromAllMailings = -1
End If
End Sub
Private Sub Form_LostFocus()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End Sub
Any Ideas?
Whenever any users enter data into the main table via a form based on the table (not on a query of the table), a blank record is inserted after the current record so that if you navigate to the final record, it is not the one you just entered, but a totally blank one.
I can tell these are just accidental blank records, because the one field with a default value (a Yes/No field with a Yes; No Value List) displays a -1 (since "Yes" is the default value), where all the others display "yes" or "no".
This is the only code attached to the form itself (note: "current info" is the field mentioned above):
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Date modified
Me!ContactInfoModifiedBy = CurrentUser()
Me!ContactDateModified = Now()
If Me.CurrentInfo = "No" Or Me.chkBlacklisted = -1 Then
Me.CourseCatalog = 0
Me.OmitFromAllMailings = -1
End If
End Sub
Private Sub Form_LostFocus()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End Sub
Any Ideas?