Results 1 to 3 of 3
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    me.dirty

    all. I inherited a database. On forms that need processing; the person who designed it has a "close button" and "refresh button". The users are under the impression that they cannot close without hitting the refresh button to save the record. Here's the code for the close button:
    Code:
    Private Sub Command35_Click()
    On Error GoTo Err_Command35_Click
    
        If Me.Dirty Then Me.Dirty = False
        DoCmd.Close
    Exit_Command35_Click:
        Exit Sub
    Err_Command35_Click:
        MsgBox Err.Description
        Resume Exit_Command35_Click
        
    End Sub
    To confirm; doesn't me.dirty = false save the record when they close? It seems redundant to hit the refresh then close. Here's the code for refresh:
    Code:
    Private Sub Command43_Click()
    On Error GoTo Err_Command43_Click
    
        DoCmd.RunCommand acCmdRefresh
    Exit_Command43_Click:
        Exit Sub
    Err_Command43_Click:
        MsgBox Err.Description
        Resume Exit_Command43_Click
        
    End Sub
    Please verify. I would like to hide the refresh button so they will be forced to close the log to avoid locks.
    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thank you so much. Got it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Dirty property for Text Box
    By tylerg11 in forum Forms
    Replies: 6
    Last Post: 04-07-2015, 11:02 AM
  2. Me.Dirty not catching
    By Ashe in forum Forms
    Replies: 4
    Last Post: 10-27-2011, 11:30 AM
  3. On Dirty fires but Me.Dirty = False (v2010)
    By Rod in forum Programming
    Replies: 5
    Last Post: 07-30-2011, 08:42 PM
  4. Dirty
    By JEPEDEWE in forum Programming
    Replies: 1
    Last Post: 11-13-2010, 04:50 PM
  5. Delete and Dirty functions
    By Evgeny in forum Programming
    Replies: 3
    Last Post: 05-03-2010, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums