[AccessD] Prevent displaying a form until...

jwcolby jwcolby at colbyconsulting.com
Thu Aug 26 21:07:57 CDT 2010


That works!  My code gets a pointer to the form object.  When I test the User's groups against the 
forms groups, if the user is not allowed to open the form I set the form.visible = false and then 
display the message.

Works great!

And so my Presentation Level Security passes it's first test, correctly implementing group 
membership for the user and checking that membership against the form's group memberships for 
Visible, AllowEdit, AllowAdd and AllowDelete.  Woohoo!

Next comes the control properties Visible, Enabled and Locked.


John W. Colby
www.ColbyConsulting.com


Drew Wutka wrote:
> If you are adding the event to all forms, just make all the forms not
> visible, and only set the visible property to true when the security
> class 'ok's the user.
> 
> Drew
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Thursday, August 26, 2010 3:00 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Prevent displaying a form until...
> 
> I am starting to test my table driven Presentation Level Security
> system.  I have a login etc.  When 
> a form opens, in the OnOpen I initialize an instance of the class that
> will drive the security for 
> that form.  I do it there because I can set Cancel = true to force the
> form to shut back down if the 
> user is not allowed to use the form.
> 
> The problem is that the form *displays* even if it eventually shuts back
> down.
> 
> This is an issue because I pop up a message box saying that the user is
> not allowed to open the 
> form, but it is already open and displaying data behind the message box.
> Oooops.
> 
> The only other time I have addressed this issue I opened a dummy form in
> front of the form being 
> opened so that the form actually being opened was hidden.  That is an
> ugly solution to a common problem.
> 
> Has anyone solved this problem in an elegant fashion.
> 



More information about the AccessD mailing list