Solved

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

Posted on 2003-11-30
4
604 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
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 250 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Read about achieving the basic levels of HRIS security in the workplace.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now