Need a Save button that closes the form

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
 
B

Bruce M. Thompson

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

DoCmd.Close acForm, Me.Name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top