Event Procedure help

G

Guest

How do I add another line to close the Contacts form upon clicking the Gifts command button

Private Sub Gift_Details_Click(
On Error GoTo Err_Gift_Details_Clic
If IsNull(Me![ContactID]) The
MsgBox "Enter contact information before entering a gift.
Els
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer7
DoCmd.OpenForm "Gifts
End I

Exit_Gift_Details_Click
Exit Su

Err_Gift_Details_Click
MsgBox Err.Descriptio
Resume Exit_Gift_Details_Clic

End Sub
 
F

fredg

How do I add another line to close the Contacts form upon clicking the Gifts command button.

Private Sub Gift_Details_Click()
On Error GoTo Err_Gift_Details_Click
If IsNull(Me![ContactID]) Then
MsgBox "Enter contact information before entering a gift."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Gifts"
End If

Exit_Gift_Details_Click:
Exit Sub

Err_Gift_Details_Click:
MsgBox Err.Description
Resume Exit_Gift_Details_Click

End Sub

Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Gifts"
DoCmd.Close acForm, Me.Name
End If
 
T

tina

have you tried putting

DoCmd.Close

after the Save Record line?

by the way, you can replace the "DoCmd.DoMenuItem..." with

RunCommand acCmdSaveRecord
 

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