Message Box Question

  • Thread starter Thread starter Don Rountree
  • Start date Start date
D

Don Rountree

I have a form that may be closed without the primary
index value being entered. When this happens an error
message is displayed. I would like to override that
error message with one of my own. I also want to be able
to close the form without further error messages (also
not save the current record) by having the user to select
<Cancel> on my own Message Box. Can someone help me?

Don Rountree
 
If you don't have a sub-form, then you can for a cancel use:

me.Undo
docmd.Close

The undo will un-do all changes, and thus the form can be closed.
 
In addition to considering the suggestions of others here, also check out
the validation text property of the table.
 
I am not suggesting the use of the OnClose event. Rather, I have
suggested the use of the OnClick event of a command button that is
clicked in order to close a form.

<putting lenses back in>

Duhh -- yes I see now. Sorry!

All the best

Tim F
 
Back
Top