A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Overriding the Shift Key on open



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2009, 09:27 PM posted to microsoft.public.access.tablesdbdesign
Lynda
external usenet poster
 
Posts: 160
Default 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  
Old February 12th, 2009, 11:50 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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  
Old February 13th, 2009, 12:39 PM posted to microsoft.public.access.tablesdbdesign
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default 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  
Old February 13th, 2009, 02:36 PM posted to microsoft.public.access.tablesdbdesign
Lynda
external usenet poster
 
Posts: 160
Default 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  
Old February 13th, 2009, 02:37 PM posted to microsoft.public.access.tablesdbdesign
Lynda
external usenet poster
 
Posts: 160
Default 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  
Old February 15th, 2009, 05:36 AM posted to microsoft.public.access.tablesdbdesign
Jack Cannon
external usenet poster
 
Posts: 151
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.