Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > ADP及SQL SERVER

有关ADP禁止SHIFT键的方法

时 间:2003-12-14 09:30:54
作 者:tmtony   ID:186  城市:中山
摘 要:有关ADP禁止SHIFT键的方法
正 文:

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 



Access软件网官方交流QQ群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助