Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Delete button on a Form

Discussion in 'Information Technology' started by Jay, Jul 28, 2006.

  1. Jay

    Jay
    Expand Collapse
    Guest

    Am I right in thinking that if data is entered into a field on a form
    then it saved as soon as the cursor is effectively moved to the next
    field, even if the user hasn't moved to the next record?

    The reason I ask is I am wanting to set up a simple form to collect
    telephone call details. But I don't want the users to move from a
    partially completed record and the partially completed record therefore
    saved.

    What I'm thinking of is having 2 command buttons at the bottom of the
    form, One to add the record & move to an empty record ready for the next
    call. And one to cancel the record they have started.

    What is the simplest event I could use for the second button, so that
    the fields in a partially completed record are cleared & not saved.

    Any help appreciated.

    Jason
     
  2. Loading...


  3. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Jay wrote:
    > Am I right in thinking that if data is entered into a field on a form
    > then it saved as soon as the cursor is effectively moved to the next
    > field, even if the user hasn't moved to the next record?


    No. That will fire update events for the control, but the entry is not "saved
    to disk" until you explicitly do so or leave the record.

    > The reason I ask is I am wanting to set up a simple form to collect
    > telephone call details. But I don't want the users to move from a
    > partially completed record and the partially completed record
    > therefore saved.


    Then make all required fields "Required" in table design. Then records can only
    be saved when all necessary fields have been populated.

    > What I'm thinking of is having 2 command buttons at the bottom of the
    > form, One to add the record & move to an empty record ready for the
    > next call. And one to cancel the record they have started.


    There are so many ways that trigger an automatic save in Access that this
    strategy has many problems. Better to properly train your users on how Access
    works. Assume a save WILL happen unless they cancel the record using the
    <escape> key.

    > What is the simplest event I could use for the second button, so that
    > the fields in a partially completed record are cleared & not saved.


    Me.Undo will cancel all pending changes, but if they have done anything that has
    already saved some changes then a button like this can be confusing because it
    will not always do what the user expects it to. This is especially true in a
    form with a subform because saves occur every time you move to or from the
    subform.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  4. betwalk@gmail.com

    betwalk@gmail.com
    Expand Collapse
    Guest

    Jay wrote:
    ....
    > What I'm thinking of is having 2 command buttons at the bottom of the
    > form, One to add the record & move to an empty record ready for the next
    > call. And one to cancel the record they have started.
    >
    > What is the simplest event I could use for the second button, so that
    > the fields in a partially completed record are cleared & not saved...


    Jason, you might want to consider using unbound forms. Then you can
    have an "OK" button that adds the data to your table (via an append
    query, for instance) and a "CANCEL" button that simply closes the
    unbound form so no action is taken with the data.

    Just a thought...

    Betsy
     

Share This Page