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

V

Valery2105

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?
 
J

John Spencer

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
 

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