In Microsoft's FAQ about ACCESS security, it gives a nice little code
to disable the shiftKey bypass thingy. I am not very good in VB coding
so I am wondering where to put the damn code in order to execute it
correctly. I mean, I know how to attach code to an action (like a
click on a button) but this code need to run even before the DB is
opened, no?
Here is the code:
Function faq_DisableShiftKeyBypass(strDBName as String, fAllow as
Boolean) As Boolean
On Error GoTo errDisableShift
Dim ws As Workspace
Dim db As DATABASE
Dim prop As Property
Const conPropNotFound = 3270
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(strDBName)
db.Properties("AllowByPassKey") = Not fAllow
faq_DisableShiftKeyBypass = fAllow
exitDisableShift:
Exit Function
errDisableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
' You must set the fourth DDL parameter to True
' to ensure that only administrators
' can modify it later. If it was created wrongly, then
' delete it and re-create it correctly.
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, False, True)
db.Properties.Append prop
Resume
Else
MsgBox "Function DisableShiftKeyBypass did not complete
successfully."
Faq_DisableShiftKeyBypass = False
GoTo exitDisableShift
End If
End Function
The other thing is that I want to limit my groups in what they can SEE
from the database. Like, I want my average users (groupe name: USERS)
to only be able to see one form, from where they will be provided with
everything they need for work, they won't see the macros, the table
etc.. How can I do that ?