PC Review Forums Newsgroups Microsoft Access Microsoft Access VBA Modules Disable AllowByPass Using ADO

Reply

Disable AllowByPass Using ADO

 
Thread Tools Rate Thread
Old 10-11-2003, 09:27 PM   #1
Lynn
Guest
 
Posts: n/a
Default Disable AllowByPass Using ADO


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
  Reply With Quote
Old 10-11-2003, 10:12 PM   #2
Dev Ashish
Guest
 
Posts: n/a
Default Re: Disable AllowByPass Using ADO

"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
  Reply With Quote
Old 12-11-2003, 06:17 PM   #3
Lynn
Guest
 
Posts: n/a
Default Re: Disable AllowByPass Using ADO

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
>.
>

  Reply With Quote
Old 13-11-2003, 05:17 PM   #4
Dev Ashish
Guest
 
Posts: n/a
Default Re: Disable AllowByPass Using ADO

"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
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off