Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Disable bypass key in an Access Project

Discussion in 'Information Technology' started by Tom Grillot, Nov 1, 2005.

  1. Tom Grillot

    Tom Grillot
    Expand Collapse
    Guest

    Is there a way to disable/enable the bypass key in an Access Project? I
    just recently upsized a running Access application (not a Project) and can't
    get the bypass key to stop working.

    And along those same lines, why does my dao code suddenly stop working?

    Thanks,
    Tom
     
  2. Loading...

    Similar Threads Forum Date
    Canada Disabled Pickering Boy, Mugged and Bullied, Takes His Own Life Breaking News Sep 29, 2011
    Legal Pay equal relief to disabled, normal victims in accident: Court Breaking News Jul 20, 2010
    General Disabled people & Reht Maryada Hard Talk Mar 19, 2010
    Sikh Rehat Marayada and the Treatment of Disabled Persons Hard Talk Jun 12, 2005
    SIKH WOMEN: Bypassed by history but why? Hard Talk Dec 6, 2013

  3. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    Check Access VB Help on the "AllowBypassKey" Property. There are
    explanation and sample code in the Help topic.

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "Tom Grillot" <tgrillot@cox.net> wrote in message
    news:zXx9f.22042$v_5.8737@dukeread07...
    > Is there a way to disable/enable the bypass key in an Access Project? I
    > just recently upsized a running Access application (not a Project) and
    > can't get the bypass key to stop working.
    >
    > And along those same lines, why does my dao code suddenly stop working?
    >
    > Thanks,
    > Tom
    >
     
  4. Tom Grillot

    Tom Grillot
    Expand Collapse
    Guest

    I guess I didn't make myself clear. I have an Access application (.mdb) for
    which I have code that will allow me to toggle the bypass key on or off:
    db.Properties("AllowBypassKey") = Not
    db.Properties("AllowBypassKey")
    with appropriate code to create the property if it hasn't already been
    created.

    When I upsized the application and rewrote everything with ado I was unable
    to find an equivalent way to do this with the ado connection or command
    objects. I also tried to just leave the dao code in place (and yes, dao 3.6
    is referenced), but Access doesn't seem to recognize the database object:
    dim db as dao.database
    set db=currentdb
    db.Properties(AllowBypassKey) = Not db.Properties(AllowBypassKey)

    generates the error message:
    .............I'll be damned.....I just reran the code to generate the error
    message and it worked. Oh, well.......thanks anyway....



    "Tom Grillot" <tgrillot@cox.net> wrote in message
    news:zXx9f.22042$v_5.8737@dukeread07...
    > Is there a way to disable/enable the bypass key in an Access Project? I
    > just recently upsized a running Access application (not a Project) and
    > can't get the bypass key to stop working.
    >
    > And along those same lines, why does my dao code suddenly stop working?
    >
    > Thanks,
    > Tom
    >
     
  5. Tom Grillot

    Tom Grillot
    Expand Collapse
    Guest

    I guess I didn't make myself clear. I have an Access application (.mdb) for
    which I have code that will allow me to toggle the bypass key on or off:
    db.Properties("AllowBypassKey") = Not
    db.Properties("AllowBypassKey")
    with appropriate code to create the property if it hasn't already been
    created.

    When I upsized the application and rewrote everything with ado I was unable
    to find an equivalent way to do this with the ado connection or command
    objects. I also tried to just leave the dao code in place (and yes, dao 3.6
    is referenced), but Access doesn't seem to recognize the database object:
    dim db as dao.database
    set db=currentdb
    db.Properties(AllowBypassKey) = Not db.Properties(AllowBypassKey)

    generates the error message:
    "Object variable or With block Variable not set"

    Here's the exact code:

    Public Sub DisableShift()
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Const conPropNotFound As Long = 3270

    On Error GoTo err_proc

    Set db = CurrentDb
    db.Properties("AllowBypassKey") = Not
    db.Properties("AllowBypassKey")
    Set db = Nothing
    Exit Sub

    err_proc:
    If Err = conPropNotFound Then
    Set prop = db.CreateProperty("AllowBypassKey", dbBoolean, False)
    db.Properties.Append prop
    Resume Next
    Else
    MsgBox Err.Number & ": " & Err.Description
    Set db = Nothing
    End If
    End Sub

    PS: If you happened to read my first response to this thread, I canceled
    it. Turns out I was testing with the old database.


    "Tom Grillot" <tgrillot@cox.net> wrote in message
    news:zXx9f.22042$v_5.8737@dukeread07...
    > Is there a way to disable/enable the bypass key in an Access Project? I
    > just recently upsized a running Access application (not a Project) and
    > can't get the bypass key to stop working.
    >
    > And along those same lines, why does my dao code suddenly stop working?
    >
    > Thanks,
    > Tom
    >



    "Tom Grillot" <tgrillot@cox.net> wrote in message
    news:zXx9f.22042$v_5.8737@dukeread07...
    > Is there a way to disable/enable the bypass key in an Access Project? I
    > just recently upsized a running Access application (not a Project) and
    > can't get the bypass key to stop working.
    >
    > And along those same lines, why does my dao code suddenly stop working?
    >
    > Thanks,
    > Tom
    >
     
  6. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    I knew you were using ADP and in ADP, you cannot use CurrentDb. That's why
    I referred you to the Help topic which advises to use the
    AccessObjectProperties collection of the CurrentProject object.:

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "Tom Grillot" <tgrillot@cox.net> wrote in message
    news:sQV9f.135$IC.73@dukeread07...
    >I guess I didn't make myself clear. I have an Access application (.mdb)
    >for
    > which I have code that will allow me to toggle the bypass key on or off:
    > db.Properties("AllowBypassKey") = Not
    > db.Properties("AllowBypassKey")
    > with appropriate code to create the property if it hasn't already been
    > created.
    >
    > When I upsized the application and rewrote everything with ado I was
    > unable
    > to find an equivalent way to do this with the ado connection or command
    > objects. I also tried to just leave the dao code in place (and yes, dao
    > 3.6
    > is referenced), but Access doesn't seem to recognize the database object:
    > dim db as dao.database
    > set db=currentdb
    > db.Properties(AllowBypassKey) = Not db.Properties(AllowBypassKey)
    >
    > generates the error message:
    > "Object variable or With block Variable not set"
    >
    > Here's the exact code:
    >
    > Public Sub DisableShift()
    > Dim db As DAO.Database
    > Dim prop As DAO.Property
    > Const conPropNotFound As Long = 3270
    >
    > On Error GoTo err_proc
    >
    > Set db = CurrentDb
    > db.Properties("AllowBypassKey") = Not
    > db.Properties("AllowBypassKey")
    > Set db = Nothing
    > Exit Sub
    >
    > err_proc:
    > If Err = conPropNotFound Then
    > Set prop = db.CreateProperty("AllowBypassKey", dbBoolean,
    > False)
    > db.Properties.Append prop
    > Resume Next
    > Else
    > MsgBox Err.Number & ": " & Err.Description
    > Set db = Nothing
    > End If
    > End Sub
    >
    > PS: If you happened to read my first response to this thread, I canceled
    > it. Turns out I was testing with the old database.
    >
     
  7. Tom Grillot

    Tom Grillot
    Expand Collapse
    Guest

    Thanks. I have to admit I didn't even go there (I'm sure you guessed that).
    I assumed it dealt with the dao procedure.

    Anyway, I'm going there now and apologize for not checking out your
    reference before I responded.

    Thanks again,
    Tom
    "Van T. Dinh" <VanThien.Dinh@discussions.microsoft.com> wrote in message
    news:uNQMfF$3FHA.3628@TK2MSFTNGP12.phx.gbl...
    >I knew you were using ADP and in ADP, you cannot use CurrentDb. That's why
    >I referred you to the Help topic which advises to use the
    >AccessObjectProperties collection of the CurrentProject object.:
    >
    > --
    > HTH
    > Van T. Dinh
    > MVP (Access)
    >
    >
    >
    > "Tom Grillot" <tgrillot@cox.net> wrote in message
    > news:sQV9f.135$IC.73@dukeread07...
    >>I guess I didn't make myself clear. I have an Access application (.mdb)
    >>for
    >> which I have code that will allow me to toggle the bypass key on or off:
    >> db.Properties("AllowBypassKey") = Not
    >> db.Properties("AllowBypassKey")
    >> with appropriate code to create the property if it hasn't already been
    >> created.
    >>
    >> When I upsized the application and rewrote everything with ado I was
    >> unable
    >> to find an equivalent way to do this with the ado connection or command
    >> objects. I also tried to just leave the dao code in place (and yes, dao
    >> 3.6
    >> is referenced), but Access doesn't seem to recognize the database object:
    >> dim db as dao.database
    >> set db=currentdb
    >> db.Properties(AllowBypassKey) = Not db.Properties(AllowBypassKey)
    >>
    >> generates the error message:
    >> "Object variable or With block Variable not set"
    >>
    >> Here's the exact code:
    >>
    >> Public Sub DisableShift()
    >> Dim db As DAO.Database
    >> Dim prop As DAO.Property
    >> Const conPropNotFound As Long = 3270
    >>
    >> On Error GoTo err_proc
    >>
    >> Set db = CurrentDb
    >> db.Properties("AllowBypassKey") = Not
    >> db.Properties("AllowBypassKey")
    >> Set db = Nothing
    >> Exit Sub
    >>
    >> err_proc:
    >> If Err = conPropNotFound Then
    >> Set prop = db.CreateProperty("AllowBypassKey", dbBoolean,
    >> False)
    >> db.Properties.Append prop
    >> Resume Next
    >> Else
    >> MsgBox Err.Number & ": " & Err.Description
    >> Set db = Nothing
    >> End If
    >> End Sub
    >>
    >> PS: If you happened to read my first response to this thread, I canceled
    >> it. Turns out I was testing with the old database.
    >>

    >
    >
     

Share This Page