actually, there IS going back from that...you just have to
set it up carefully. here's the code i've been using the
last 4 years:
Public Sub SetStartupPropertiesT()
ChangeProperty "AllowBypassKey", dbBoolean, True
MsgBox "The database is UNlocked, when you next open
the application."
End Sub
Public Sub SetStartupPropertiesF()
ChangeProperty "AllowBypassKey", dbBoolean, False
MsgBox "The database is LOCKED, when you next open the
application."
End Sub
Public 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 'prop not found
Set prp = dbs.CreateProperty(strPropName,
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
'unkown error
ChangeProperty = False
Resume change_bye
End If
End Function
save the above code in a standard module. then open (in
design view) whatever form opens when the db opens. add a
transparent (and tiny) command button to the form, and set
the Tab Stop property to No. call procedure
SetStartupPropertiesT() in the On Click event. set the
Caption property to an unusual key combination, one the
user is not likely to use accidentally. viola, now you can
open and "unlock" the db whenever you want to. make sure
you test the "unlock" before "locking" the db. to lock it,
open the standard module and run procedure
SetStartupPropertiesF() from the module window.
i got the code from Access Help.
(this is a second posting - the first didn't seem to go
thru. if it double-posts, sorry.)