Need a Save button that closes the form

Ask a Question related to Microsoft Access, Design and Development.

  1. #1

    Default Need a Save button that closes the form

    I've created a Save button that saves the data entered but
    I also want it to close the form. Here's what I have with
    my On Click event. This works but doesn't close the form.

    HELP!!!!

    Private Sub Save_Record_Click()

    On Error GoTo Err_Save_Record_Click

    DoCmd.DoMenuItem acFormBar, acRecordsMenu,
    acSaveRecord, , acMenuVer70

    Exit_Save_Record_Click:
    Exit Sub

    Err_Save_Record_Click:
    MsgBox Err.Description
    Resume Exit_Save_Record_Click

    End Sub

    Diana Minks Guest

  2. Similar Questions and Discussions

    1. Save Button
      How do you create a 'SAVE' button instead of a 'SAVE AS' button? Im using Acrobat Pro 9.
    2. Batch Crop Action - auto save files without having to hit 'save' button
      Hi, A while ago I spent a long time trying to figure out an action that would automatically crop my photos to a 4x3 aspect ratio to use in video....
    3. Creating button to Save Record and Close Form
      Use the VB Editor window to add a line as follows: Docmd.Close acform, Me.Name The line should be added immediately after the save command...
    4. Save my (ass)ets! Trying to Link a button to a frame in another scene
      I'm using Flash 4 and I can't get my button to link to the main scene in my flash program. I created a movie button within a movie button and I'm...
    5. JavaScript Access to Button in form tags (webcontrol or html button)
      Hello, I have a button called LoadBtn, which exists in <form name="Form1" runat=server></form> tags. I then have javascript loaded outside of...
  3. #2

    Default Re: Need a Save button that closes the form

    You need to add a line after the "save" command to close the form:

    DoCmd.Close acForm, Me.Name

    --
    Bruce M. Thompson, Microsoft Access MVP
    [email]bthmpson@mvps.org[/email] (See the Access FAQ at [url]http://www.mvps.org/access[/url])
    >>No Email, Please. Keep all communications
    within the newsgroups so that all might benefit.<<

    "Diana Minks" <diana.minks@alltel.com> wrote in message
    news:027d01c34703$081fed90$a101280a@phx.gbl...
    > I've created a Save button that saves the data entered but
    > I also want it to close the form. Here's what I have with
    > my On Click event. This works but doesn't close the form.
    >
    > HELP!!!!
    >
    > Private Sub Save_Record_Click()
    >
    > On Error GoTo Err_Save_Record_Click
    >
    > DoCmd.DoMenuItem acFormBar, acRecordsMenu,
    > acSaveRecord, , acMenuVer70
    >
    > Exit_Save_Record_Click:
    > Exit Sub
    >
    > Err_Save_Record_Click:
    > MsgBox Err.Description
    > Resume Exit_Save_Record_Click
    >
    > End Sub
    >

    Bruce M. Thompson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139