If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Overriding the Shift Key on open
I have determined how to override the use of the shift key when opening the
database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
#2
|
|||
|
|||
Overriding the Shift Key on open
You can set this property programmatically, from another database that you
use to maintain your databases. For example, using the function below: Set db = OpenDatabase("C:\SomeFolder\SomeFile.mdb") Call ChangeProperty(db, "AllowBypassKey", dbBoolean, False) Function ChangeProperty(dbs As Database, strPropName As String, _ varPropType As Variant, varPropValue As Variant) As Integer Dim prp As Property Const conPropNotFoundError = 3270 On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True Debug.Print strPropName & " is " & varPropValue Change_Bye: Exit Function Change_Err: If Err = conPropNotFoundError Then 'Property not found. Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else 'Any other error. ChangeProperty = False Resume Change_Bye End If End Function What I personally do is to use code like this to set the StartupShowDBWindow, AllowSpecialKeys, and AllowBypassKey properties of the MDE that will become the new front end for users, each time I release a new version. The development version (MDB) never has these properties set. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Lynda" wrote in message ... I have determined how to override the use of the shift key when opening the database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
#3
|
|||
|
|||
Overriding the Shift Key on open
Based on a thread in another newsgroup, I'd recommend using
Dim prp As DAO.Property rather than simply Dim prp As Property -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Allen Browne" wrote in message ... You can set this property programmatically, from another database that you use to maintain your databases. For example, using the function below: Set db = OpenDatabase("C:\SomeFolder\SomeFile.mdb") Call ChangeProperty(db, "AllowBypassKey", dbBoolean, False) Function ChangeProperty(dbs As Database, strPropName As String, _ varPropType As Variant, varPropValue As Variant) As Integer Dim prp As Property Const conPropNotFoundError = 3270 On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True Debug.Print strPropName & " is " & varPropValue Change_Bye: Exit Function Change_Err: If Err = conPropNotFoundError Then 'Property not found. Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else 'Any other error. ChangeProperty = False Resume Change_Bye End If End Function What I personally do is to use code like this to set the StartupShowDBWindow, AllowSpecialKeys, and AllowBypassKey properties of the MDE that will become the new front end for users, each time I release a new version. The development version (MDB) never has these properties set. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Lynda" wrote in message ... I have determined how to override the use of the shift key when opening the database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
#4
|
|||
|
|||
Overriding the Shift Key on open
Thanks a bunch. I'll give it a try.
Lynda "Allen Browne" wrote: You can set this property programmatically, from another database that you use to maintain your databases. For example, using the function below: Set db = OpenDatabase("C:\SomeFolder\SomeFile.mdb") Call ChangeProperty(db, "AllowBypassKey", dbBoolean, False) Function ChangeProperty(dbs As Database, strPropName As String, _ varPropType As Variant, varPropValue As Variant) As Integer Dim prp As Property Const conPropNotFoundError = 3270 On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True Debug.Print strPropName & " is " & varPropValue Change_Bye: Exit Function Change_Err: If Err = conPropNotFoundError Then 'Property not found. Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else 'Any other error. ChangeProperty = False Resume Change_Bye End If End Function What I personally do is to use code like this to set the StartupShowDBWindow, AllowSpecialKeys, and AllowBypassKey properties of the MDE that will become the new front end for users, each time I release a new version. The development version (MDB) never has these properties set. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Lynda" wrote in message ... I have determined how to override the use of the shift key when opening the database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
#5
|
|||
|
|||
Overriding the Shift Key on open
Thanks a bunch. I'll try it out.
Lynda "Douglas J. Steele" wrote: Based on a thread in another newsgroup, I'd recommend using Dim prp As DAO.Property rather than simply Dim prp As Property -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Allen Browne" wrote in message ... You can set this property programmatically, from another database that you use to maintain your databases. For example, using the function below: Set db = OpenDatabase("C:\SomeFolder\SomeFile.mdb") Call ChangeProperty(db, "AllowBypassKey", dbBoolean, False) Function ChangeProperty(dbs As Database, strPropName As String, _ varPropType As Variant, varPropValue As Variant) As Integer Dim prp As Property Const conPropNotFoundError = 3270 On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True Debug.Print strPropName & " is " & varPropValue Change_Bye: Exit Function Change_Err: If Err = conPropNotFoundError Then 'Property not found. Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else 'Any other error. ChangeProperty = False Resume Change_Bye End If End Function What I personally do is to use code like this to set the StartupShowDBWindow, AllowSpecialKeys, and AllowBypassKey properties of the MDE that will become the new front end for users, each time I release a new version. The development version (MDB) never has these properties set. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Lynda" wrote in message ... I have determined how to override the use of the shift key when opening the database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
#6
|
|||
|
|||
Overriding the Shift Key on open
Lynda,
Allen and Doug have both offered excellent and appropriate suggestions. However, I will offer another that you may wish to consider. I check to see if the file is an mde or mdb. If an mde it is set to false everytime the program runs. If an mdb it is set to true everytime the program runs. In either case the program has to run at least once to set the property correctly. Since the mdb file never has the property set to false, it is always available for diagnostic purposes. Jack Cannon "Lynda" wrote: I have determined how to override the use of the shift key when opening the database by setting the "AllowBypassKey" property to false. However, once I do this, how do I get into the database to make design changes??? Only way I can see is to keep an unlocked copy for design changes and add the lock when I distribute the front end. Any suggestions??? |
Thread Tools | |
Display Modes | |
|
|