Results 1 to 2 of 2

Thread: Disable Bypass

  1. #1
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011

    Unanswered: Disable Bypass

    Years ago, I picked up this nice little ditty to disable the bypass key (in Access 97).

    Now that I have Access 2003, with the apps in 2000 format, it no longer works. Any ideas why, and more important, how do I disable the bypass in 2000/2003 (and equally important, can I re-enable using code)?

    Code:
    Sub DisableBypass(AllowIt As Boolean)
    
        Dim prp As Property
        
        On Error Resume Next
        CurrentDb.Properties("AllowBypassKey") = AllowIt
        If Err Then
            Err.Clear
            Set prp = CurrentDb.CreateProperty("AllowBypassKey", dbBoolean, AllowIt)
            CurrentDb.Properties.Append prp
            Set prp = Nothing
        End If
    End Sub
    thanks,
    tc

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Argh, silly me, I just figured it out.

    Code:
    Sub DisableBypass(AllowIt As Boolean)
    
        Dim prp As DAO.Property
        
        On Error Resume Next
        CurrentDb.Properties("AllowBypassKey") = AllowIt
        If Err Then
            Err.Clear
            Set prp = CurrentDb.CreateProperty("AllowBypassKey", dbBoolean, AllowIt)
            CurrentDb.Properties.Append prp
            Set prp = Nothing
        End If
    End Sub
    I wouldn't have thought PROPERTY was part of the data object collection. Is there an ADO version of this? In order to further my knowledge, how would I do this without using DAO?

    Thanks,
    tc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •