AllowByPassKey (1 Viewer)

muratas2

Registered User.
Local time
Today, 14:38
Joined
Jan 18, 2000
Messages
16
Hi,

I have a multi-user application and want to set AllowByPassKey True or False depending on the login user name. i.e. if the username written in the Login box is not a specific one I don't want this property to be active. How can I write such a code to be executed at startup?

Thanx in advance

Murat
 
C

cbasulto

Guest
The CurrentUser() function returns the login name if that is all you need.

such as ;

AllowByPassKeys = (CurrentUser() = "Admin")

If you want more advanced information about security and groups you could use complicated code, but I have a simpler solution. Create a form that has no data or controls, but closes itself as soon as it is open. Set the user rights of this form equal to the ones you want for your other code and then attempt to open it whenever you need to test the user's security level. If it returns an error capture it and you will know if the user has adequate security for the code you are running. This also allows you to change security levels for your code without changing the code itself.

such as;

AllowByPassKeys = CanOpenSecureForm()

where the CanOpenSecureForm() function returns false if it gets the error above.
 

Users who are viewing this thread

Top Bottom