In deed, why kick a user out if you can prevent him from getting into the database to start with?
I will start by saying that security of Jet data should not be considered infallible, however there are steps you can take to protect your application from 'most' users.
1) Built in security. Like it or love it, there are many opinions on Ms Access's own security methods. Using the wizard, you can create users and groups to have specific permissions on various objects. Some say this is hard to set up, others say it's caused them problems, whilst many have enjoyed it's simplicity and security.
But even with this type of security implemented, your databsae could still be subject to having iyts objects inported into a new DB, or the MDB read with a third party app..
2) Database password. No restrictions once you have the password, but is kind of a brickwall if you don't know it. Personally I don't use this method, as it doesn't allow for multiple users.
3) Create your own.
This is where things can be customised a bit more that the other two, depending a) how much time you have and b) how good your vb skills are.
Assuming both situations are negative, there are 'quick-wins' to achive what you are trying to do.
i) Ensure that you have a form selected to open at startup.
ii) Create a table with one field ("Username") and populate this with each user's NT login, who you wish to allow access to the database.
iii) Put the following code within the On_Open event of that form:
Code:
Dim rs as dao.recordset
Dim strSQL as string
strSQL = "SELECT * FROM tblUsers WHERE Username = '" & Environ("UserName") & "'"
Set rs = Currentdb.openrecordset(strSQL)
If rs.BOF then
docmd.Quit
End If
iv) Change the Windows startup options to hide the database window
v) Change the Windows startup options to disallow the Special Keys, so users cannot press F11 to get to the database window.
vi) Set the AllowByPassKey* property to False (disabled) to prevent the holding of shift when the DB starts up, thus showing the database window, and ignoring your lovely startup form's code.
* there's some great code from MVPS.org for this property... check this link out:
Good luck.. post if you need more help/clarification
------------------------
Hit any User to continue