Results 1 to 9 of 9

Thread: CLOSE Macro pb

  1. #1
    Join Date
    May 2008
    Posts
    6

    Unanswered: CLOSE Macro pb

    Hello everybody,

    I try to use the CLOSE MACRO in ACCESS 2003 to close a formular without updating the data (for example because i type some mistakes in the different fields of my formular and i don't want to save it at close time).
    So i define a button calling a macro with the following action:

    CLOSE
    Object type: Formular
    Formular name: My_Form_ex1
    Register: NO

    But i record nevertheless the modifications.
    In fact i can choice Register: NO, YES or to confirm
    it's always the same result...I record the modifications.
    Wat i can do ?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ditch macros and swtich to vba code
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2008
    Posts
    6

    Unhappy YES but...

    Thank's for your answer.
    But i try the following VBA module and the result ...is the same !

    '------------------------------------------------------------
    ' STOPSAISIE_D
    '
    '------------------------------------------------------------
    Function STOPSAISIE_D()
    On Error GoTo STOPSAISIE_D_Err
    ' DEVSAISIE_D

    DoCmd.Close acForm, "DEVSAISIE_D", acSaveNo

    STOPSAISIE_D_Exit:
    Exit Function

    STOPSAISIE_D_Err:
    MsgBox Error$
    Resume STOPSAISIE_D_Exit

    End Function

    '------------------------------------------------------------



    Modifications are always recorded !
    What i can do ?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    The save in the Close command is referring to saving DESIGN changes, not DATA changes. If you want to abandon changes to the record, you have to first UNDO before you close.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    May 2008
    Posts
    6

    Help

    OK thank's to your explaination.

    But how to do UNDO at the Forms level ?
    I have to write a VBA code i think, but i am beginner and i don't know to do that.
    Any help will be very appreciate.
    Thank's by anticipation

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    From memory:
    Code:
    DoCmd.RunCommand acCmdUndo
    George
    Home | Blog

  7. #7
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Nice trick George, Thanx for that
    <<Never Walk on the Traveled Path, Because it only Leads you to where the Others have been.>>
    Graham Bell

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I'd use Me.Undo personally
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    May 2008
    Posts
    6

    Smile Nice George

    Thank's George that runs very well !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •