Double error messages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks. I'm still having trouble with error messages- I get my own and then
the Access generated one as well.

I have:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim iAns As Integer
If Member = True And IsNull(Me!MemberDate) Then
iAns = MsgBox("Please enter a Member 'Since' Date to continue, or click
Cancel to erase this record", vbOKCancel)
If iAns = vbOK Then
Cancel = True
Me!MemberDate.SetFocus
Else
Cancel = True
Me.Undo ' erase the entire form
End If
End If
End Sub

So if I try to close the form before completing MemberDate, a nice error
message pops up.

But then the second error message pops up:
Microsoft Access: You can't save this record at the time. Access may have
encountered an error while trying to save a record. If you close this object
now, the data changes you made will be lost. Do you want to close the
database object anyway?

If I click "no" I can go back and complete the MemberDate field no problem.
By the way, MemberDate is not a required field in my table.

How can I fix it so only my message box pops up?
 
Answer in next post twelve minutes later.

FYI: Give us time to see your post and answer, at least one day, not 12
minutes. This is an all volunteer site and is not monitored by Microsoft
personnel.
 
Back
Top