Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still having trouble on Removing Access screen

Status
Not open for further replies.

eggy168

Programmer
Mar 6, 2002
220
0
0
US
Hi,
I've been reading over and over again on the thread(s) and the FAQ so many times. However, I still having trouble to have the Disable/Re-enable Shift Key working on the FrontMenu
1) I used the Tools/StartUp way to hide the Access Window Screen by uncheck the followings:
a)Display Database Window
b)Display Status Bar
c)Allow Full Menus
d)Allow Built-in Toolbars
e)Allow Default Shortcut Menus
f)Allow Toolbar/Menu Changes
g)Use Access Special Keys
Then, I chose my own form, "frmFront" in the Display Form/Page section and choose OK.

It works perfect: Only show the form, frmFront the next time I open the database.

Here comes the tricky part:
2) I put 2 buttons on the frmFront: Disable and Re-enables
'this code disables the shift key
1dim db as dao.database
2dim prp as dao.property
3set db = currentdb
4set prp = db.createproperty ("AllowByPassKey", dbBoolean, False)
5db.properties.append prp
'this code re-enable the shift key
1dim db as dao.database
2set db = currentdb
3db.properties.delete "AllowByPassKey"
4db.properties.refresh

The two buttons either sits there doing nothing (I click the Re-Enable key, and I press the Shift F11, it doesn't work) or it comes an error on line 3.

Thanks
 
Hello,

What I do to re-enable the shift key is:

With DB.Properties
.Delete "AllowBreakIntoCode"
End With

You do not need the with - I use it as I am deleting a number of user defined properties.

Hope this helps.

[Afro2]
 
Sorry I forgot to say to :

Set DB = DBEngine(0)(0)

For some reason this works for me.

[Afro2]
 
PolerYan,

Set db = DBEngine(0)(0) doesn't work for me.
Is there any other ways to do it?
Thanks
 
Hello,

I checked the help menu and it states that this property's setting doesn't take effect until the next time the application database opens. I was defining other properties in the code I was using for my Database.

I would like to know the answer though.

Good luck and sorry I could not help.
[Sad]

 
If you can access the code of your database then, in a module tape this code :

Sub EnableShift()

SetProperty CurrentDb, "AllowByPassKey", True

End Sub

If you can't access the code, then you have to create a second database and add this code in a module :

Sub EnableShift()
Dim db As dao.Database

Set db = OpenDatabase("C:\..\YourDataBase.mdb")

SetProperty db, "AllowByPassKey", True

End Sub

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top