?
Solved

Disable Shift Key in Access 2000 , VB (version 6)

Posted on 2003-11-30
4
Medium Priority
?
651 Views
Last Modified: 2009-12-16
Hello,

I know it is possible , i looked arround for a lot of solutions via google and non of them worked in my access 2000 vb.
i want to be able to disable the shift key for an access db and when i want - i want to be able to enable the shift key, can you help me with a working vb code ?


Bye
Dori
0
Comment
Question by:DoRi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:bluzeman
ID: 9845223
Look in Help for the AllowBypassKey property.

Rick
0
 
LVL 8

Accepted Solution

by:
Benjamin_Luk earned 1000 total points
ID: 9848311
Put following code under modle:
Then use macro [run code] to call it
1. Diable it set [Function Name]=DisShift()
2.Enable it set [Function Name]=Enshift()

Function DisShift()
    ChangeProperty "AllowBypassKey", dbBoolean, False
End Function
Function EnShift()
    ChangeProperty "AllowBypassKey", dbBoolean, True
End Function
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFoundError = 3270
    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True
Change_Bye:
    Exit Function
Change_Err:
    If Err = conPropNotFoundError Then  ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function

Regards

Ben
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question