Results 1 to 2 of 2
  1. #1
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115

    Salvataggio maschere

    Hello, I have a form and subform I close with the code [code]
    Private Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)


    On Error Resume Next


    KeyNum KeyCode =
    If KeyCode = 39 And Me.Note.SelLength> 0 Then
    Me.Note.SelLength = 0
    Me.Note.SelStart = Len (Me.Note.Text)
    end If
    On Error GoTo 0
    If KeyCode = vbKeyEscape Then btnClose_Click
    end Sub


    Private Sub btnClose_Click ()
    On Error GoTo Err_btnClose_Click
    DoCmd.Close acForm, "F_main2"
    Exit_btnClose_Click:
    Exit Sub
    Err_btnClose_Click:
    MsgBox Err.Description
    Resume Exit_btnClose_Click
    End Sub [/ code]
    At the end, however, it asks me to save the form and the subform. How do I change the code so that everything is saved when I go out?
    thanks
    Hello

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The code isn't changing design so to prevent the prompt, try:

    DoCmd.Close acForm, "F_main2", acSaveNo.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

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