What VBA is used to close all forms open by clicking "x" close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new at VBA coding. I have a .db that is a library.db. When opening the
form that displays ID code, Author, Title, Booked In By, Book Out Date etc..
another form which acts as a search form is opened at the same time. There
is a code written to automatically do this but what i need is a code to close
both forms when clicking on the "x" button on the top right hand corner of
the "display form". Can anyone please help me with a code?
 
All you need to do is add code to the close event of the Dispplay form that
will close the other form.

Private Sub Form_Close()
DoCmd.Close acForm, "TheNameOfTheOtherForm"
End Sub
 
Back
Top