AllowBypassKey in adp for certain SQLServer role

  • Thread starter mdullni1 via AccessMonster.com
  • 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
 
A

aaron.kempf

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top