Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2005

Tip: Looking for answers? Try searching our database.

Stop macro based on user-level security

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
csepgomez - 05 Jan 2005 17:11 GMT
I have a database that I assigned user-level security to stop certain users
from create/update/delete data and thus blocking access to certain forms.  
Normally to access these forms a user will click a button, depending on type
of form i.e. create, details (read-only), or update.  The button was created
using a macro.  When a restricted user (read-only) clicks on, for ex.
"Create" button, they successfully receive a message stating they do not have
sufficient permission.  But then my macro fails and an "Action Failed" window
appears with option to Halt macro.  

I would like to either set a condition in macro or add code to automatically
halt or stop macro behind the scenes.  Does anyone know if this is possible
(based on user-level security)?
John Nurick - 05 Jan 2005 23:11 GMT
This is possible in VBA but not, as far as I know, with macros.

>I have a database that I assigned user-level security to stop certain users
>from create/update/delete data and thus blocking access to certain forms.  
[quoted text clipped - 8 lines]
>halt or stop macro behind the scenes.  Does anyone know if this is possible
>(based on user-level security)?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
csepgomez - 06 Jan 2005 02:41 GMT
I have converted the macro to vba ... I thought I would be able to use code
to call macro and then use and if...then statement to halt macro if action
failed.

> This is possible in VBA but not, as far as I know, with macros.
>
[quoted text clipped - 15 lines]
>
> Please respond in the newgroup and not by email.
John Nurick - 06 Jan 2005 06:13 GMT
Either set up error handling and trap the errors, or - and much better -
write code that checks the user's group membership (see e.g.
http://www.access-programmers.co.uk/forums/archive/index.php/t-70864.html)
when the form loads and adjusts the Visible or Enabled properties of the
buttons accordingly.

>I have converted the macro to vba ... I thought I would be able to use code
>to call macro and then use and if...then statement to halt macro if action
[quoted text clipped - 19 lines]
>>
>> Please respond in the newgroup and not by email.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
csepgomez - 06 Jan 2005 14:01 GMT
Thanks, but I didnt have to go to that extent... the security automatically
displayed message stating cant open form.  All my code has is the open form
command.  That was suffice.  Thanks for the information, it was very helpful
and will consider for future.

> Either set up error handling and trap the errors, or - and much better -
> write code that checks the user's group membership (see e.g.
[quoted text clipped - 30 lines]
>
> Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.