Advertisement

10.01.2007 at 08:07AM PDT, ID: 22863873
[x]
Attachment Details

Disable shift key in MS Access 2003

Asked by TerenceHewett in Access Coding/Macros, Microsoft Access Database

Tags: shift, access, disable, key, 2003

Hi experts,

I am trying to disable the shift key in my MS Access 2003 application so that users cannot bypass the runtime MDE properties and access the design view where they have a full version of MS Access.  I have found the following code in the Microsoft knowledgebase but cannot make it work in my application.  Do I need to modifications to this code to make it work?

Sub SetBypassProperty()
Const DB_Boolean As Long = 1
    ChangeProperty "AllowBypassKey", DB_Boolean, False
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Object, prp As Variant
    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

Any help would be appreciated.

Regards,
TerryStart Free Trial
[+][-]10.01.2007 at 08:40AM PDT, ID: 19991469

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.01.2007 at 08:41AM PDT, ID: 19991480

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database
Tags: shift, access, disable, key, 2003
Sign Up Now!
Solution Provided By: wiswalld
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.05.2007 at 07:28AM PDT, ID: 20022135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628