Message Box Question

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
 
A

Albert D. Kallal

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.
 
H

HSalim

In addition to considering the suggestions of others here, also check out
the validation text property of the table.
 
T

Tim Ferguson

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
 

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

Top