jwcolby
jwcolby at colbyconsulting.com
Sun May 22 22:17:48 CDT 2011
Interestingly... My C2DbProperties application can read the values out and display them in check boxes. AllowBreakIntoCode is not being toggled true false as I toggle its check box, remaining always cleared. I wonder if this is the same issue as I had with AllowByPassKey, needing to be run from inside of the database container before it will work from outside of the container. John W. Colby www.ColbyConsulting.com On 5/22/2011 11:01 PM, jwcolby wrote: > Well, I finally "got it" on the DisableBypassKey thing. > > I executed the ap_DisableBypassKey property *from inside* of the application and it in fact does > disable the bypass key. Once executed from inside of the application, the set / reset of that > property correctly works from my external tool as well. > > So se por que. > > jwc > > Function ap_DisableShift() > 'This function disable the shift at startup. This action causes > 'the Autoexec macro and Startup properties to always be executed. > > On Error GoTo errDisableShift > > Dim db As DAO.Database > Dim prop as DAO.Property > Const conPropNotFound = 3270 > > Set db = CurrentDb() > > 'This next line disables the shift key on startup. > db.Properties("AllowByPassKey") = False > > 'The function is successful. > Exit Function > > errDisableShift: > 'The first part of this error routine creates the "AllowByPassKey > 'property if it does not exist. > If Err = conPropNotFound Then > Set prop = db.CreateProperty("AllowByPassKey", _ > dbBoolean, False) > db.Properties.Append prop > Resume Next > Else > MsgBox "Function 'ap_DisableShift' did not complete successfully." > Exit Function > End If > > End Function > > Function ap_EnableShift() > 'This function enables the SHIFT key at startup. This action causes > 'the Autoexec macro and the Startup properties to be bypassed > 'if the user holds down the SHIFT key when the user opens the database. > > On Error GoTo errEnableShift > > Dim db as DAO.Database > Dim prop as DAO.Property > Const conPropNotFound = 3270 > > Set db = CurrentDb() > > 'This next line of code disables the SHIFT key on startup. > db.Properties("AllowByPassKey") = True > > 'function successful > Exit Function > > errEnableShift: > 'The first part of this error routine creates the "AllowByPassKey > 'property if it does not exist. > If Err = conPropNotFound Then > Set prop = db.CreateProperty("AllowByPassKey", _ > dbBoolean, True) > db.Properties.Append prop > Resume Next > Else > MsgBox "Function 'ap_DisableShift' did not complete successfully." > Exit Function > End If > > End Function