Access 2000: How to not save changes on exit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ellgre
    New Member
    • Feb 2008
    • 1

    Access 2000: How to not save changes on exit

    I have got a form where I have among other controls have two subforms. The SourceObjects of the subforms are queries qrySub1 and qrySub2. When data is changed in a listbox-control the sql of the queries is changed. I use the property querydef.sql to change the SQL og the queries.

    When closing the form I get a message where it asks me if I want to save the changed objects. Is there a way to stop the message box asking for saving the objects to come up?

    I have tried to stop it in onFormClose, but it seems like the message box is created before the onFormClose.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    Try to avoid changing the design of the forms themselves.
    For this situation consider applying filters instead.

    FYI: the code if you DID need to make changes to the design during a run is :
    Code:
    Call DoCmd.Close(ObjectType:=acForm, _
                     ObjectName:=Me.Name, _
                     [U][B]Save:=acSaveNo[/B][/U])
    This assumes you're closing it from within its own code (ObjectName:=Me .Name).

    Comment

    Working...