In most of my forms, the only way to close a form is to click on a"Close"
button.
First, in the form properties, on the FORMAT tab, set the "Close button"
property to NO.
Then add a button control to the form. Name it "btnClose". For the click
event, add this:
Private Sub btnClose_Click()
' your code to remove-from-list call goes here
' remove-from-list (or whatever you call it)
DoCmd.Close acForm, Me.Name
End Sub
Now the remove-from-list call only runs when the button is clicked :D
HTH

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Hi All,
>
[quoted text clipped - 18 lines]
> Regards,
> Max
Max Moor - 15 May 2008 05:52 GMT
=?Utf-8?B?U3RldmUgU2FuZm9yZA==?= <limbim53 at yahoo dot com> wrote in
news:BDE4AAC9-8D1E-44D6-A684-7174016D084F@microsoft.com:
> In most of my forms, the only way to close a form is to click on
> a"Close" button.
[quoted text clipped - 15 lines]
>
> HTH
Hi Steve,
Thanks for the reply. Sorry I didn't cover the whole story better.
I'm actually doing what you suggest in a couple of forms now, but I
don't want to. What I have is an app where all open forms maximize
into the entire MDI space. Currently, I use an 'X' label with an
OnClick event that does as you suggested. What I really wanted was
for the system close button to be available in the menu bar (standard
maximized form stuff), but be able to trap that click, or something.
Effectively, I want to tell the difference between a
system-close-button-close and a close for any other reason.
Regards,
Max
Steve Sanford - 16 May 2008 03:55 GMT
Max,
I did some searching...there are some examples of using APIs with forms on
"The Access Web" (mvps.org/access/api/index.html).... mostly changing form
size.
Maybe you could develop something from the examples. For me, its like the
joke about the roof......... It's (API programming) way over my head! :P
I use the button code because it is easy and I can modify it. I have a
template form with my form design - the close button is one control I have on
the template. It is quicker to delete it than recreate it on new forms.
Anyway, sorry I couldn't help you.

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> =?Utf-8?B?U3RldmUgU2FuZm9yZA==?= <limbim53 at yahoo dot com> wrote in
> news:BDE4AAC9-8D1E-44D6-A684-7174016D084F@microsoft.com:
[quoted text clipped - 33 lines]
> Regards,
> Max
Max Moor - 16 May 2008 19:20 GMT
=?Utf-8?B?U3RldmUgU2FuZm9yZA==?= <limbim53 at yahoo dot com> wrote in
news:5E3BBB4A-1E91-4352-B3BF-2D2AADA05E10@microsoft.com:
> Max,
>
[quoted text clipped - 11 lines]
>
> Anyway, sorry I couldn't help you.
Hi Again Steve,
I think I'm going to stick with the same thing. the little x label
looks just like the real thing, and as you say, I can control it easily.
The only real difference is that it's in the form space and not the menu
bar space. The only person that is ever going to care is the anal
retentive developer that put it there. :-)
At any rate, I appreciate your replies. Even if I didn't get the
answer I hoped for, it's good to have a second opinion on things.
Regards,
Max