Switchboard

  • Thread starter Thread starter David
  • Start date Start date
D

David

Is there a way to make it that the switchboard can't be closed?

Thanks,

Dave
 
Well, you'll need to have some way of indicating when it's okay to close
(i.e.: you'll have to provide a button to let them close the database).

Create a module-level variable mbooOkToClose by putting the following line
at the beginning of the form's module, before any sub or function:

Private mbooOkToClose As Boolean

In the Click event of your Close button, see that flag to True:

Private Sub cmdClose_Click()

mbooOkToClose = True

End Sub

In the Unload event of the form, put code like:

Private Sub Form_Unload(Cancel As Integer)

Cancel = (mbooOkToClose = False)

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

Similar Threads

Access Switchboard error message 1
switchboard problem 4
Switchboard Minimized 4
Switchboard in Access 2007 1
I've lost my Switchboard ! 3
Form Event 2
SWITCHBOARD 1
Switchboard question 3

Back
Top