Event Procedure help

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
have you tried putting

DoCmd.Close

after the Save Record line?

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

RunCommand acCmdSaveRecord
 
Back
Top