I decided to have a fiddle with the database and see if I could hide things from view, so I went to the start-up options, ticked all the boxes, then pressed ok,
Worked great hid everything, but how do I get it back?
It sounds like you trying to hide your entire database from users? and only let them see a form to input data.
I have created a database that has a front end form and that is all they see. Only the form. All other information about the database is unavailable to them. I as the author can turn this feature on, and when I need to work in the database, turn this feature off so I can see all information in the database.
If this sound like what you need, let me know and I will post the code.
Kirk
Hey Jim,
I created a main menu form that opens automatically when the database is opened. On this form are, among other buttons, 2 ones called run time and developer. Run time removes from view the database and everything else except the main menu. Developer button puts all information back for all to see. Both buttons should point to the following module code.
Option Compare Database
Option Explicit
Private Sub B_debug_Click()
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
MsgBox "Application Properties changed. Reopen database to see affect."
End Sub
Private Sub b_RunTime_Click()
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
MsgBox "Application Properties changed. Reopen database to see affect."
End Sub
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
PS always make a backup of the database before any changes are made incase of an unrecoverable error. I learned the hard way.
Let me know how you make out.
Kirk
If you need to set the database so savy users cannot do this, you will need to set the startup property "AllowShiftKeyBypass" using the ChangeProperty code listed by Kirk. I believe before changing the property, though you must create it. Do a keyword search on AllowShiftKeyBypass. I caution you, however, make sure that you have a way of changing your AllowShiftKeyBypass back to True.
SATHandle
definition of 'less behind': "not fully caught up, digging out slowly, one-week delay to "The IT hit the fan."
Just to clarify, my code has nothing to do with setting up the "AllowShiftKeyBypass" propertys. These are 2 different and equally good ways to do hide the database from users.
Thanks, JRBarnett. That DoCmd.RunCommand in your first response just stopped a major panic attack. I turned off the menus to the point where I couldn't get them back, and for some reason, the Shift key on startup wasn't letting me see them either.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.