×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Turn off Shift Bypass key in .adp

Turn off Shift Bypass key in .adp

Turn off Shift Bypass key in .adp

(OP)
The following code works great in a .mdb but not for a .adp.  This is the module I use to turn the Shift Bypass key off. Does ANYONE know what I need to change to get it to work?  



Public Function SetProperties(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer

On Error GoTo Err_SetProperties

Dim db As DAO.Database, prp As DAO.Property

        Set db = CurrentDb
            db.Properties(strPropName) = varPropValue
        SetProperties = True
        Set db = Nothing
    
Exit_SetProperties:
Exit Function

Err_SetProperties:
    If Err = 3270 Then 'Property not found
        Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
        db.Properties.Append prp
        Resume Next
    Else
        SetProperties = False
        MsgBox "SetProperties", Err.Number, Err.Description
    Resume Exit_SetProperties
End If
End Function

RE: Turn off Shift Bypass key in .adp

Good Afternoon!

Below it the title of the article that relates to the startup properties of a Project.  The article covers programming in both the *.adp and *.mdb environments.  I have used it to set a few of the properties for my applications.  Sorry, I have not used it for the ByPass key yet.
  
Setting Startup Options Programmatically in Access 2000

' *** Here is some of the code ***

Public Sub SetADPAppTitle()
   Dim dbs As CurrentProject
   Dim prp As ADODB.Property
   Dim strTitle As String

   Const INVALID_PROPERTY_REFERENCE As Integer = 2455

On Error GoTo ErrorHandler

   Set dbs = Application.CurrentProject
   strTitle = "Setting *.ADP Startup Options"

   'Try to set the property, if it fails, the property does not exist.
   dbs.Properties("AppTitle") = strTitle

' *** Here is one of the start up properties ***
   dbs.Properties("StartupShowDBWindow") = False

   'Refresh the title bar to reflect the change.
   Application.RefreshTitleBar
   
ExitLine:
   Set dbs = Nothing
   Set prp = Nothing
   Exit Sub

ErrorHandler:
   If Err.Number = INVALID_PROPERTY_REFERENCE Then
      ' Create the new property.
      dbs.Properties.Add "AppTitle", strTitle
      Resume Next
   Else
      Resume ExitLine
   End If
End Sub
' *****************************************

I hope this helps!!!

Good Luck!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close