M
mdullni1 via AccessMonster.com
I am using Access 2003 adp.
I've read the posts on this site on how to set the AllowBypassKey property.
If I understand it correctly, you have to execute CurrentProject.Properties.
Add "AllowByPassKey", True after the adp is opened, and then exit and enter
again before the shift key actually works.
I would like to have the adp allow the shift key only if the user is in the
"db_owner" role in SQLServer without having to enter the adp twice.
Currently in my startup form I am executing SQLServer Is_Member function via
a UDF. If member of db_owner, CurrentProject.Properties.Add "AllowByPassKey",
True is executed. Unfortunately, this is too late. Also, according to the
MS doc, autoexec is executed after startup options so that would be too late
as well.
Do anyone know of a way to check the user and set the AllowByPassKey value
before startup options are run?
FWIW, I am using this "ToggleKeys" function I found on this site:
Public Sub ToggleKeys(Optional ByVal KeyState As Boolean = True)
With CurrentProject
With .Properties
.Add "AllowByPassKey", KeyState
.Item("AllowByPassKey").Value = KeyState
.Add "AllowSpecialKeys", KeyState
.Item("AllowSpecialKeys").Value = KeyState
End With
End With
End Sub
Thanks,
Peg
I've read the posts on this site on how to set the AllowBypassKey property.
If I understand it correctly, you have to execute CurrentProject.Properties.
Add "AllowByPassKey", True after the adp is opened, and then exit and enter
again before the shift key actually works.
I would like to have the adp allow the shift key only if the user is in the
"db_owner" role in SQLServer without having to enter the adp twice.
Currently in my startup form I am executing SQLServer Is_Member function via
a UDF. If member of db_owner, CurrentProject.Properties.Add "AllowByPassKey",
True is executed. Unfortunately, this is too late. Also, according to the
MS doc, autoexec is executed after startup options so that would be too late
as well.
Do anyone know of a way to check the user and set the AllowByPassKey value
before startup options are run?
FWIW, I am using this "ToggleKeys" function I found on this site:
Public Sub ToggleKeys(Optional ByVal KeyState As Boolean = True)
With CurrentProject
With .Properties
.Add "AllowByPassKey", KeyState
.Item("AllowByPassKey").Value = KeyState
.Add "AllowSpecialKeys", KeyState
.Item("AllowSpecialKeys").Value = KeyState
End With
End With
End Sub
Thanks,
Peg