Public Function lockDB()
On Error GoTo HandleErr
vKey = InputBox("Enter value to set key", "Enter Code"

If Val(vKey) = 1234 Then
SetBypassKey True
Else
SetBypassKey False
End If
lockDB = True
ExitHere:
Exit Function
' Error handling block added by Error Handler Add-In. DO NOT EDIT this block of code.
' Automatic error handler last updated at 12-20-2000 14:53:36 'ErrorHandler:$$D=12-20-2000 'ErrorHandler:$$T=14:53:36
HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Utility.lockDB" 'ErrorHandler:$$N=Utility.lockDB
End Select
' End Error handling block.
End Function
Sub SetBypassKey(ByVal vKey As Boolean)
Dim cp As CurrentProject
On Error GoTo HandleErr
Set cp = CurrentProject
cp.Properties("AllowBypassKey"

= vKey
ExitHere:
Exit Sub
' Error handling block added by Error Handler Add-In. DO NOT EDIT this block of code.
' Automatic error handler last updated at 12-20-2000 14:53:49 'ErrorHandler:$$D=12-20-2000 'ErrorHandler:$$T=14:53:49
HandleErr:
Debug.Print Err.Number
Select Case Err.Number
Case 2455
cp.Properties.Add "AllowBypassKey", vKey
Resume Next
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Utility.SetBypassKey" 'ErrorHandler:$$N=Utility.SetBypassKey
End Select
' End Error handling block.
End Sub
This is what I wrote for that...
hth
Alcar