protect the database so only form shows.

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I need to make a form that when you close it, the program closes. I do not
want the user to be able to see the underlying tables and queries.
thank you
Michael
 
You are asking two different questions. To close the database with the
form, just include code in the form's close event. That does not prevent
the user from moving that form to the side or minimizing it and seeing your
other objects.

To truly prevent the users from getting to your tables and queries, you'd
need to implement User-Level Security and take away their access from those
objects. You'd need to base your forms and reports on queries set to run
with owner's permission.

To prevent the database window from being seen when opened, you'd need to
change the setting in your startup options and not allow the shift bypass
key. You'd also want to remove menus and toolbars. To make sure your form
starts with the database, you need to put it in the startup options. You
might also set it as pop-up and modal.
 
In addition, to close the app completely from the form, you can use the
DoCmd.Quit code behind the form's events that the user uses to exit the
application to completely quit the application.
 
And/Or/Also
From the Menu go to
Tools
Startup
Uncheck the "Display Database Window" checkbox.

This will NOT stop someone from using the Shift method of entering, but
if they use the normal execute method, the databases will NOT show even
after all the forms are closed. This will help if they close the form
using the "X" instead of your close button.

Although you may want to try putting docmd.quit in the OnClose event of
the form.
However this also says you cannot close the form yourself in any
testing since it will close quit the application.

Ron
Ron
 
Back
Top