Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

705 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