prevent saving when just closing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michiel Rapati-Kekkonen

    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

  • Stuart McCall

    #2
    Re: prevent saving when just closing

    "Michiel Rapati-Kekkonen" <nn@nonsense.zz wrote in message
    news:eyM1k.55$O V1.35@read4.ine t.fi...
    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.


    Comment

    • Roger

      #3
      Re: prevent saving when just closing

      On Jun 5, 1:26 am, "Michiel Rapati-Kekkonen" <n...@nonsense. zzwrote:
      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

      Comment

      • Michiel Rapati-Kekkonen

        #4
        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.zz wrote in message
        news:eyM1k.55$O V1.35@read4.ine t.fi...
        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
        >

        Comment

        • Michiel Rapati-Kekkonen

          #5
          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.zz wrote in message
          news:mSQ1k.137$ OV1.61@read4.in et.fi...
          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.zz wrote in message
          news:eyM1k.55$O V1.35@read4.ine t.fi...
          >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
          >>
          >
          >

          Comment

          • Les Desser

            #6
            Re: prevent saving when just closing

            In article <mSQ1k.137$OV1. 61@read4.inet.f i>, Michiel Rapati-Kekkonen
            <nn@nonsense.zz Thu, 5 Jun 2008 12:20:34 writes
            >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)

            Comment

            • Roger

              #7
              Re: prevent saving when just closing

              On Jun 7, 5:52 pm, Les Desser <NewsDu...@dess ergroup.comwrot e:
              In article <mSQ1k.137$OV1. ..@read4.inet.f i>, Michiel Rapati-Kekkonen
              <n...@nonsense. zzThu, 5 Jun 2008 12:20:34 writes
              >
              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

              Comment

              • Les Desser

                #8
                Re: prevent saving when just closing

                In article
                <397387d2-02c3-44e5-968a-6b9553b41567@m3 6g2000hse.googl egroups.com>,
                Roger <lesperancer@na tpro.comSun, 8 Jun 2008 06:42:43 writes
                >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)

                Comment

                Working...