Setting a reference to the form isn't what you want.
All you need is
Private Sub Command87_Click()
DoCmd.Close acForm, "frm_AddtlToolsCasesUIBAll"
DoCmd.Close acForm, Me.Name
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
"Iram" <Iram@discussions.microsoft.com> wrote in message
> I need help writing code to close two forms at the click of a button. I
> the below code but it keeps erroring out.
> I want to close a form called "frm_AddtlToolsCasesUIBAll" and the current
> form that I am on/the form that has the button to close both forms.
> How should I rewrite this?
> Private Sub Command87_Click()
> Dim frm_theOtherForm As Form
> Set frm_theOtherForm = Forms![frm_AddtlToolsCasesUIBAll].Form
> Set frm_theOtherForm = Nothing
> End Sub
> Your help is greatly appreciated.