RE: protect my data base window



To disable the database window view via the *** key.

You will need to billed a second database only you have access to it with
the following code.

Make a Public Funtion:
Public Function ChangeShift(strMDBName As String, fChange As Boolean)

On Error GoTo ChangeShift_Err
Dim db As Database, prp As Property
Set db = DBEngine(0).OpenDatabase(strMDBName)
db.Properties("AllowBypassKey") = fChange

ChangeShift_Done:
MsgBox "The proper"
Set db = Nothingty 'AllowBypassKey' from" & vbCrLf _
& strMDBName & " was changed successfully to '" _
& fChange & "'", vbInformation, "ChangeShift"

ChangeShift_End:
Set prp = Nothing
GoTo Function_End

ChangeShift_Err:
If Err = 3270 Then
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, _
fChange, True)
db.Properties.Append prp
GoTo ChangeShift_Done
Else
MsgBox "Error # " & Err & " @@" & Err.Description, _
vbExclamation, "Error"
End If

Resume ChangeShift_End
Function_End:
End Function


Then add this code to a command button on click event to diable the "shift
enter"
Private Sub cmdPromptL_Click()
ChangeShift InputBox("Please Enter a Path to the Database.", "Lock"), False

End Sub

Then add this code to a command button on click event to enable the "shift
enter".
(You will want this so you can edit the database.)
Private Sub cmdPromptU_Click()
ChangeShift InputBox("Please Enter a Path to the Database.", "UnLock"), True


End Sub


"Yousoft" wrote:

I set my data base file to startup mode and hide the (Data Base Window), but
my problem I want to protect my data base window to not view, by pressing
(shift+enter ) to the specific data base file.
Thanks

.