设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 4215|回复: 4
打印 上一主题 下一主题

[模块/函数] 有关ADP禁止SHIFT键的方法

[复制链接]

点击这里给我发消息

跳转到指定楼层
1#
发表于 2003-3-29 17:06:00 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
Function DisableBypassADP(blnYesNo As Boolean)
    CurrentProject.Properties.Add "AllowByPassKey", blnYesNo
End Function

然后在启动时调用 DisableBypassADP(false)

更详细的做法:

Function SetMyProperty(MyPropName As String, MyPropValue As Variant) As Boolean
    On Error GoTo SetMyProperty_In_Err
    Dim Ix As Integer
    With CurrentProject.Properties
    If fn_PropertyExist(MyPropName) Then  'check if it already exists
        For Ix = 0 To .Count - 1
            If .Item(Ix).Name = MyPropName Then
                .Item(Ix).Value = MyPropValue
            End If
        Next Ix
    Else
       .Add MyPropName, MyPropValue
    End If
    End With
    SetMyProperty = True

SetMyProperty_Exit:
    Exit Function

SetMyProperty_In_Err:
   
    MsgBox "设置属性出错:", Err, Error$
    SetMyProperty = False
    Resume SetMyProperty_Exit

End Function
'--------检查属性是否存在---
Private Function fn_PropertyExist(MyPropName As String) As Boolean
    fn_PropertyExist = False
    Dim Ix As Integer
    With CurrentProject.Properties
        For Ix = 0 To .Count - 1
            If .Item(Ix).Name = MyPropName Then
                fn_PropertyExist = True
                Exit For
            End If
        Next Ix
    End With
End Function


Public Function setByPass()
   SetMyProperty "AllowBypassKey", True
End Function


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-14 16:55 , Processed in 0.098277 second(s), 24 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表