G
Guest
I am using the Access ContactMgmt db template. When entering a contact you can click the calls button which opens the calls form, however it leaves the contacts form open. I want to add a line of code to close the contats form upon opening the calls form. This is the existing open code:
Private Sub Call_Details_Click()
On Error GoTo Err_Calls_Details_Click
If IsNull(Me![ContactID]) Then
MsgBox "Enter contact information before making a call."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Calls"
DoCmd.CloseForm "Contacts" ( I added this to the code and keep getting errors)
End If
Exit_Calls_Details_Click:
Exit Sub
Err_Calls_Details_Click:
MsgBox Err.Description
Resume Exit_Calls_Details_Click
End Sub
What can I add to this to open the calls form and close the contacts form. Please help.
Private Sub Call_Details_Click()
On Error GoTo Err_Calls_Details_Click
If IsNull(Me![ContactID]) Then
MsgBox "Enter contact information before making a call."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Calls"
DoCmd.CloseForm "Contacts" ( I added this to the code and keep getting errors)
End If
Exit_Calls_Details_Click:
Exit Sub
Err_Calls_Details_Click:
MsgBox Err.Description
Resume Exit_Calls_Details_Click
End Sub
What can I add to this to open the calls form and close the contacts form. Please help.