I have designed a database and split it into Front End(FE) and Back
End(BE). I have created the .mde file for the FE users. In the .mde
file FE Users can't do any thing in form, report and module but they
can play with the table and query. Some FE users can open the .mde
file with shift key and go into the database window. I don't want that
FE users see the database window.
Is there any way to hide the database window permanently with the FE
users?
Thanks in advance.
Naushad
Set the following options:
--Not show the Database window
--Set AllowSpecialKeys to No
This will keep the 'normal' user out.
BUT you might also lock yourself out... (make a backup first, just in case)
Google this group for ShiftKey and AllowByPassKey
Arno R
The following code will do a good job of locking up your database. Run it on
a copy of your db because it will lock you out also.Otherwise put in a
backdoor to run code that will undo this. Some of the changes will not be in
affect until you close and reopen the mdb.Note: if someone really wants in,
they will find a way.
' Lockup the MDB
ChangeProperty "AllowBypassKey", dbBoolean, False
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, False
Application.ShortcutMenuBar = "CustomShortCut" '
This is a custom menu to replace the builtin shortcut
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "CustomForm", acToolbarNo
DoCmd.ShowToolbar "CustomForm"
' This is a custome menubar to replace builtin
DoCmd.ShowToolbar "Table DataSheet", acToolbarNo
' Unlock the MDB
ChangeProperty "AllowBypassKey", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
Application.ShortcutMenuBar = ""
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
DoCmd.ShowToolbar "Form View", acToolbarWhereApprop
DoCmd.ShowToolbar "CustomForm", acToolbarNo ' This is
a custom menubar to replace builtin
DoCmd.ShowToolbar "Table DataSheet", acToolbarWhereApprop
Thanks for your valuable support but I couldn't understand "Put in the
back door to run code. Can you explain the same.
Thanks for your valuable support but I couldn't understand "Put in the
back door to run code. Can you explain the same.
The lock code will make it very difficult to get to the database window,
even alt-shift will not work. So you should only allow it to run on the copy
of the front-end distributed to your users. A back door is some undocumented
control or combination of controls on that front-end, not known to your user
that will run the unlock code.
Hi
When I compile your code in my database the error "Sub or Function not
defined" is shown. I think we have to define the ChangeProperty
function. So please help me to solve this problem.
Naushad
That function is documented here:
http://www.mvps.org/access/general/gen0040.htm
Cheers,
Arch
Hi
Naushad
Here is the function I am using
'---------------------------------
' Change the selected property
'
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function