Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 27th, 2008, 08:26 PM
Michiel Rapati-Kekkonen
Guest
 
Posts: n/a
Default prevent saving when just closing

Hi,

I would like my record to be saved only when my own close button (with all
it's checks) is used.
I made the winodws close button disappear, but you still can close using the
right mouse click.
also when designing, going to design mode saves the record.

So I tried: OnClose : Me.Undo.
My own cancel button uses it and it works ok,
but not in the OnClose event.

how to prevent the record to be saved when just closing.

I hope I could make myself clear...

TIA

Michiel

  #2  
Old June 27th, 2008, 08:26 PM
Stuart McCall
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:eyM1k.55$OV1.35@read4.inet.fi...
Quote:
Hi,
>
I would like my record to be saved only when my own close button (with all
it's checks) is used.
I made the winodws close button disappear, but you still can close using
the right mouse click.
also when designing, going to design mode saves the record.
>
So I tried: OnClose : Me.Undo.
My own cancel button uses it and it works ok,
but not in the OnClose event.
>
how to prevent the record to be saved when just closing.
>
I hope I could make myself clear...
>
TIA
>
Michiel
Use the form's Unload event instead. It has a parameter called Cancel which
will prevent the form from closing unleass set to True. So you can do your
checks and:

Cancel = True

if the checks fail.


  #3  
Old June 27th, 2008, 08:26 PM
Roger
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

On Jun 5, 1:26*am, "Michiel Rapati-Kekkonen" <n...@nonsense.zzwrote:
Quote:
Hi,
>
I would like my record to be saved only when my own close button (with all
it's checks) is used.
I made the winodws close button disappear, but you still can close using the
right mouse click.
also when designing, going to design mode saves the record.
>
So I tried: OnClose : Me.Undo.
My own cancel button uses it and it works ok,
but not in the OnClose event.
>
how to prevent the record to be saved when just closing.
>
I hope I could make myself clear...
>
TIA
>
Michiel
just have the form's beforeUpdate event use the same function as your
'close' button
and if there's as validation error, set the event 'cancel' to true or
undo the changes

  #4  
Old June 27th, 2008, 08:26 PM
Michiel Rapati-Kekkonen
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

thank you both for your answers
I didn't find It, yet
but I continue experimenting.

The matter is that someone is allowed to close the form,
but only the information should not be saved if they don't close it 'my way'

michiel


"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:eyM1k.55$OV1.35@read4.inet.fi...
Quote:
Hi,
>
I would like my record to be saved only when my own close button (with all
it's checks) is used.
I made the winodws close button disappear, but you still can close using
the right mouse click.
also when designing, going to design mode saves the record.
>
So I tried: OnClose : Me.Undo.
My own cancel button uses it and it works ok,
but not in the OnClose event.
>
how to prevent the record to be saved when just closing.
>
I hope I could make myself clear...
>
TIA
>
Michiel
>
  #5  
Old June 27th, 2008, 08:26 PM
Michiel Rapati-Kekkonen
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

well, I solved it with the BeforeUpdate event.
In that event the info on the form will be wiped away, unless a Boolean is
set to True by my own Close button.

thanks again for your help

michiel


"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:mSQ1k.137$OV1.61@read4.inet.fi...
Quote:
thank you both for your answers
I didn't find It, yet
but I continue experimenting.
>
The matter is that someone is allowed to close the form,
but only the information should not be saved if they don't close it 'my
way'
>
michiel
>
>
"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:eyM1k.55$OV1.35@read4.inet.fi...
Quote:
>Hi,
>>
>I would like my record to be saved only when my own close button (with
>all it's checks) is used.
>I made the winodws close button disappear, but you still can close using
>the right mouse click.
>also when designing, going to design mode saves the record.
>>
>So I tried: OnClose : Me.Undo.
>My own cancel button uses it and it works ok,
>but not in the OnClose event.
>>
>how to prevent the record to be saved when just closing.
>>
>I hope I could make myself clear...
>>
>TIA
>>
>Michiel
>>
>
>
  #6  
Old June 27th, 2008, 08:26 PM
Les Desser
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

In article <mSQ1k.137$OV1.61@read4.inet.fi>, Michiel Rapati-Kekkonen
<nn@nonsense.zzThu, 5 Jun 2008 12:20:34 writes
Quote:
>the information should not be saved if they don't close it 'my way'
Why do you want to do it that way rather than let your validation run
when the form closes any way?

I don't think my users would be very happy if they lost their input data
just because they closed the form not via a "Save" button.

It is one of the strengths of Access that it saves data by default.
--
Les Desser
(The Reply-to address IS valid)
  #7  
Old June 27th, 2008, 08:26 PM
Roger
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

On Jun 7, 5:52*pm, Les Desser <NewsDu...@dessergroup.comwrote:
Quote:
In article <mSQ1k.137$OV1...@read4.inet.fi>, Michiel Rapati-Kekkonen
<n...@nonsense.zzThu, 5 Jun 2008 12:20:34 writes
>
Quote:
the information should not be saved if they don't close it 'my way'
>
Why do you want to do it that way rather than let your validation run
when the form closes any way?
>
I don't think my users would be very happy if they lost their input data
just because they closed the form not via a "Save" button.
>
It is one of the strengths of Access that it saves data by default.
--
Les Desser
(The Reply-to address IS valid)
and if there is a validation / business rule error when they try to
'x' out, you should prompted them as to whether they want to throw
away the input, they may want to fix the error(s) prior to exiting
  #8  
Old June 27th, 2008, 08:26 PM
Les Desser
Guest
 
Posts: n/a
Default Re: prevent saving when just closing

In article
<397387d2-02c3-44e5-968a-6b9553b41567@m36g2000hse.googlegroups.com>,
Roger <lesperancer@natpro.comSun, 8 Jun 2008 06:42:43 writes
Quote:
>and if there is a validation / business rule error when they try to 'x'
>out, you should prompted them as to whether they want to throw away the
>input, they may want to fix the error(s) prior to exiting
I suppose it all depends on the "style" of your application.

All our applications save by default - if the input is valid. If not
valid then they cannot exit until they correct the input or cancel it.

Your suggestion is of course perfectly valid and may be desirable in
some applications.

For a general commercial application, there is no need to keep
confirming every input.
--
Les Desser
(The Reply-to address IS valid)
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles