RE: protect my data base window



Not sure what what happened to my first reply but here it is again.

Make a new database.
Add this public function:
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 these two command button onclick events to Lock(disable shift) and
unlock(enable shift) respectively.


ChangeShift InputBox("Please Enter a Path to the Database.", "Lock"), False


ChangeShift InputBox("Please Enter a Path to the Database.", "UnLock"), True




"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

.


Loading