Double error messages

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?
 
G

G. Vaught

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dual Error messages 1
Required fields 1
My code- she ain't pretty! 1
Save record & stay on same record 9
No current record/DoMenuItem cancelled 7
Before update on form 5
Code ain't pretty 3
error when saving 1

Top