Need a Save button that closes the form

  • Thread starter Thread starter Diana Minks
  • Start date Start date
D

Diana Minks

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
 
You need to add a line after the "save" command to close the form:

DoCmd.Close acForm, Me.Name
 
Back
Top