How to close Entry Search Form without saving?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lorax
    New Member
    • Jan 2011
    • 1

    How to close Entry Search Form without saving?

    I am new to this. I am recreating a form from ACCESS 2000 in Access 2010. The problem is that ACCESS no longer allow one to close a form without saving it.

    Form: a search form that allows people to enter data to search records based on ID, DOB and Lname. There is no data entry of any type. No saving of any data. It is a simple dialogue box that allows for a search.

    This is the code:

    Private Sub cmd_close_parti ent_lookup_Clic k()
    On Error GoTo Err_cmd_close_p artient_lookup_ Click

    DoCmd.Close

    Exit_cmd_close_ partient_lookup _Click:
    Exit Sub

    Err_cmd_close_p artient_lookup_ Click:
    MsgBox Err.Description
    Resume Exit_cmd_close_ partient_lookup _Click

    End Sub

    When I try to close the form now, I get an error message. I have not changed any of the code, but ACCESS 2010 is not allowing it to close without saving. Also is there anyway to this to work via a macro?

    Help?
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    In cases such as this one...it helps quite alot posting the error message...


    First thing to try:
    Check your form properties to confirm that Recordsource is blank.

    Second thing to try:
    Post the error code, as well as the description you are getting.


    Last:
    I have not worked in Ac2010, but I confident that you should be able to close a form by using a macro. I always prefer VBA code however.

    Comment

    Working...