open the database to the database window. on the menu bar, click Tools |
Startup. in the Startup dialog, set Display Form/Page to the name of your
menu form, from the droplist. uncheck the box next to Display Database
Window. also, uncheck the box next to Use Access Special Keys (the preceding
applies to A2003. if you're using A2000, i think those "special keys" are
controlled by individual checkboxes, and show up in the dialog when you
click an "Options" or "Additional Options" or "Special Options" button -
something like that. i haven't used A2000 for a couple years, sorry...).
your user can still bypass the Startup setting simply by holding down the
Shift key while opening the database, and that little trick is very easy to
learn about - from books and all over the internet. if you want to go an
extra step, you can disable the AllowBypass option in the database. the code
i normally use follows. make sure that you can *enable* AllowBypass from the
user interface *before* you disable it.
hth
Public Function isResetF()
SetStartupPropertiesF
End Function
Public Function SetStartupPropertiesF()
Const lngBoolean As Long = 1
ChangeProperty "AllowBypassKey", lngBoolean, False
MsgBox "The database is LOCKED, when you next open the application."
End Function
Public Function isResetT()
SetStartupPropertiesT
End Function
Public Function SetStartupPropertiesT()
Const lngBoolean As Long = 1
ChangeProperty "AllowBypassKey", lngBoolean, True
MsgBox "The database is UNlocked, when you next open the application."
End Function
Public Function ChangeProperty(strPropName As String, varPropType As
Variant, _
varPropValue As Variant) As Integer
Dim db As Object, Prop As Variant
Const conPropNotFoundError = 3270
Set db = CurrentDb
On Error GoTo HANDLE_ERROR
db.Properties(strPropName) = varPropValue
ChangeProperty = True
LAST_EXIT:
Exit Function
HANDLE_ERROR:
If err = conPropNotFoundError Then ' Property not found.
Set Prop = db.CreateProperty(strPropName, _
varPropType, varPropValue)
db.Properties.Append Prop
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume LAST_EXIT
End If
End Function