Home > Archive > MS Access Multiuser > April 2005 > Re: How can I disable SHIFT+ENTER only for certain users in a MsAc









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How can I disable SHIFT+ENTER only for certain users in a MsAc
Jose Perdigao

2005-04-09, 8:27 pm

Good Morning Geo,

How can we run your code?
I try, but I don't know which values I must give to strPropName,
varPropType, varPropValue.

Could you explain to me the steps to run this code?

Thanks a lot,

José Perdigão


"Geo" wrote:

> Yeaaaaah!!!
> Here is a solution:
>
> Option Compare Database
> Option Explicit
>
>
> Public Function dd()
> If CurrentUser() <> "admin" Then
> If CurrentUser() <> "ChosenUser" Then
> ChangeProperty "AllowBypassKey", dbBoolean, False
> Else
> ChangeProperty "AllowBypassKey", dbBoolean, True
> DoCmd.Quit
> End If
> Else
> ChangeProperty "AllowBypassKey", dbBoolean, False
> DoCmd.Quit
> End If
>
> End Function
> Function ChangeProperty(strPr
opName As String, varPropType As Variant,
> varPropValue As Variant) As Integer
> Dim dbs As Database, prp As Property
> Const conPropNotFoundError
= 3270
>
> Set dbs = CurrentDb
> On Error GoTo Change_Err
> dbs. Properties(strPropNa
me) = varPropValue
> ChangeProperty = True
>
> Change_Bye:
> Exit Function
>
> Change_Err:
> If Err = conPropNotFoundError
Then ' Property not found.
> Set prp = dbs. CreateProperty(strPr
opName, varPropType, varPropValue)
> dbs.Properties.Append prp
> Resume Next
> Else
> ' Unknown error.
> ChangeProperty = False
> Resume Change_Bye
> End If
> End Function
>
> (C) Mitrica Dan
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com