By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

where to write shiftkey disable code

P: 44
sir,
now when i open the database tools menu is not coming.i want that only.
but if i open my database by pressing shift button tools menu is coming.i have a code to disable the shift key
where i have to write the code.
where is the database property allowbypassshiftkey.i didnt find that
where i have to write the shiftkey disable code
May 20 '07 #1
Share this Question
Share on Google+
7 Replies


ADezii
Expert 5K+
P: 8,627
sir,
now when i open the database tools menu is not coming.i want that only.
but if i open my database by pressing shift button tools menu is coming.i have a code to disable the shift key
where i have to write the code.
where is the database property allowbypassshiftkey.i didnt find that
where i have to write the shiftkey disable code
I use the code frequently but I am at work and do not have it handy. I'll post it for you early this evening unless someone beats me to the punch.
May 20 '07 #2

ADezii
Expert 5K+
P: 8,627
sir,
now when i open the database tools menu is not coming.i want that only.
but if i open my database by pressing shift button tools menu is coming.i have a code to disable the shift key
where i have to write the code.
where is the database property allowbypassshiftkey.i didnt find that
where i have to write the shiftkey disable code
Expand|Select|Wrap|Line Numbers
  1. Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
  2.    Dim dbs As Object, prp As Variant
  3.    Const conPropNotFoundError = 3270
  4.  
  5.    Set dbs = CurrentDb
  6.    On Error GoTo Change_Err
  7.    dbs.Properties(strPropName) = varPropValue
  8.    ChangeProperty = True
  9.  
  10. Change_Bye:
  11.    Exit Function
  12.  
  13. Change_Err:
  14.    If Err = conPropNotFoundError Then    ' Property not found.
  15.        Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
  16.        dbs.Properties.Append prp
  17.        Resume Next
  18.    Else
  19.        ' Unknown error.
  20.        ChangeProperty = False
  21.        Resume Change_Bye
  22.    End If
  23. End Function
To call the Function:
Expand|Select|Wrap|Line Numbers
  1. Const DB_Boolean As Long = 1
  2. 'To allow the SHIFT Key By By-Pass
  3. ChangeProperty "AllowBypassKey", DB_Boolean, True
May 20 '07 #3

P: 44
sir
i know the code.
but where we have to write that code in modules or where
i am not getting
please help me
May 21 '07 #4

ADezii
Expert 5K+
P: 8,627
sir
i know the code.
but where we have to write that code in modules or where
i am not getting
please help me
You can place the code in the Open() Event of your Main Form. The next time you Open your Database, the change will have taken effect. Be sure you allow yourself a 'Backdoor' into the Database.
May 21 '07 #5

jamjar
P: 50
You can place the code in the Open() Event of your Main Form. The next time you Open your Database, the change will have taken effect. Be sure you allow yourself a 'Backdoor' into the Database.
Thanks - I've been wondering how you do this. Three questions:

  1. How does this run if holding the shift key down prevents the main form from opening?
  2. How do you set a backdoor?
  3. Is there any way to re-establish the full menus once the db is opened?
I guess - depending if the backdoor has to be activated at startup or can be done later - questions 2 and 3 are related.



James
May 23 '07 #6

P: 44
Sub DisableShiftKey()

Dim db As DAO.Database
Dim prp As DAO.Property

Set db = CurrentDb
db.Properties.Delete "AllowBypassKey"
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, False, True)
db.Properties.Append prp

db.Properties.Refresh

Set prp = Nothing
Set db = Nothing

End Sub
i wrote this code in the start up form on open event.but it is not working
what to do
please help me.when i convert to mde format tables r opening.iwant tables sholu not open.is there any way.
May 23 '07 #7

ADezii
Expert 5K+
P: 8,627
Thanks - I've been wondering how you do this. Three questions:

  1. How does this run if holding the shift key down prevents the main form from opening?
  2. How do you set a backdoor?
  3. Is there any way to re-establish the full menus once the db is opened?
I guess - depending if the backdoor has to be activated at startup or can be done later - questions 2 and 3 are related.



James
For some Databases, I'll disable the SHIFT ByPass and also deselect all Options in Tools ==> StartUp among other things. To get back in to the Database, I'll create an AutoKeys Macro with a complex Shortcut Key combination which will execute RunCommand ==> StartUp Properties. I will then select all Options and open the Database again to allow full access.
May 23 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.