AllowBypassKey in adp for certain SQLServer role

  • Thread starter Thread starter mdullni1 via AccessMonster.com
  • Start date Start date
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 frequently just lock everyone out of everything; and then i have a
shortcut key / autokeys-- using a MACRO-- that will trap F12 and allow
people to enter a password (using a Password / InputBox)

-Aaron
 
Back
Top