PC Review
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Disable AllowByPass Using ADO
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Disable AllowByPass Using ADO
![]() |
Disable AllowByPass Using ADO |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Does anyone have the code to disable the shift key using
ADO. I can find tons of examples using DAO, but need to do this in ADO. thanks |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"Lynn" <anonymous@discussions.microsoft.com> wrote in news:097301c3a7c9
$1fa64000$a001280a@phx.gbl: > > Does anyone have the code to disable the shift key using > ADO. I can find tons of examples using DAO, but need to > do this in ADO. > You want this for an ADP, correct? Using CurrentProject will not work for MDB where you must use the Access.Properties collection. In ADP, you have to use CurrentProject.AccessObjectProperties (as noted in help for AllowBypassKey). ' *** Code Start *** Sub SetAllowBypassKey(value As Boolean) Call ChangeProperty_ADP("AllowBypassKey", value) End Sub Sub CheckAllowBypassKey() On Error Resume Next Debug.Print Application.CurrentProject. _ Properties("AllowBypassKey") End Sub Sub ChangeProperty_ADP(propertyName As String, _ propertyValue As Variant) Dim props As AccessObjectProperties Dim prop As AccessObjectProperty Dim isPresent As Boolean Set props = Application.CurrentProject.Properties For Each prop In props If (StrComp(prop.Name, propertyName, vbTextCompare) = 0) Then isPresent = True Exit For End If Next If (isPresent) Then props(propertyName).value = propertyValue Else props.Add propertyName, propertyValue End If End Sub ' *** Code End *** -- Dev |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks for the code, but can you tell me how you are
calling it. >-----Original Message----- >"Lynn" <anonymous@discussions.microsoft.com> wrote in news:097301c3a7c9 >$1fa64000$a001280a@phx.gbl: > >> >> Does anyone have the code to disable the shift key using >> ADO. I can find tons of examples using DAO, but need to >> do this in ADO. >> > >You want this for an ADP, correct? Using CurrentProject will not work for >MDB where you must use the Access.Properties collection. In ADP, you have >to use CurrentProject.AccessObjectProperties (as noted in help for >AllowBypassKey). > >' *** Code Start *** >Sub SetAllowBypassKey(value As Boolean) > Call ChangeProperty_ADP("AllowBypassKey", value) >End Sub > >Sub CheckAllowBypassKey() > On Error Resume Next > Debug.Print Application.CurrentProject. _ > Properties("AllowBypassKey") >End Sub > >Sub ChangeProperty_ADP(propertyName As String, _ > propertyValue As Variant) >Dim props As AccessObjectProperties >Dim prop As AccessObjectProperty >Dim isPresent As Boolean > > Set props = Application.CurrentProject.Properties > For Each prop In props > If (StrComp(prop.Name, propertyName, vbTextCompare) = 0) Then > isPresent = True > Exit For > End If > Next > > If (isPresent) Then > props(propertyName).value = propertyValue > Else > props.Add propertyName, propertyValue > End If >End Sub >' *** Code End *** > > -- Dev >. > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
"Lynn" <anonymous@discussions.microsoft.com> wrote in news:002601c3a940
$cf877cf0$a401280a@phx.gbl: > Thanks for the code, but can you tell me how you are > calling it. SetAllowBypassKey true or SetAllowBypassKey false Or did I misinterpret you? -- Dev |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

