Results 1 to 14 of 14
  1. #1
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Prevent users from accessing certain forms at certain times.

    I'm not sure if this is the correct place, I have a database made up of at least 6 forms. My staff only need access to one or two at a time and given their inexperience, I'd like to prevent them going into a form at a time they didn't need to.



    Any ideas?

    I wondered about using their staffgp (admin or user) to set forms as active or inactive but have drawn a blank using my fairly new programming skills as to how to do this.

    Many thanks


    Sent from my iPhone using Tapatalk

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Update. I've created a vba function which checks to see whether the usergroup has access to the form ATM. But how do I "store" the usergroup whilst the user is on the database.


    Sent from my iPhone using Tapatalk

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    So I don't understand the criteria concerning.... 'not going into a form at a time they didn't need to'... as I don't understand what 'time' criteria is relevant. But here is generic advice:
    a. Either thru a log-in form or system info one obtains a unique User ID
    b. place that data in an unbound text box in a form that is always open - or -write it into a table (potentially holding in bound text box in a form that is always open)
    c. one needs a table containing their ID and their Permission Code (i.e. 1, 2, 3) so that in your logic of visibility or openings you can rely on permission code rather than coding per person.
    d. DLookUp is used to find a user's Permission Code

    Using their code as criteria: Either don't display buttons of forms they should not use by controlling visibility of controls - or - make the opening event conditional on their code

    The permission code approach is a little more complicated but scales to lots of users - assuming they all can be segregated into a permission class. If it were just a few users and won't change - you could skip the permission class and just hard code based on their ID.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I would recommend creating different front-ends for your different users (a shared database should be split anyway, see: https://support.office.com/en-us/art...3-51b1d73498cc). In a split database, each user has their own copy of the front-end. You can have as many different front-end versions as you like/need. So, they would just have a version that has just the Forms they need, and not any that they don't.

    Note: If you do NOT split your database, and have multiple users accessing the same copy, you are prone to corruption and errors! Don't risk it, split the database.

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Thx guys. I work in a school and can't split the database unless they say I can. The Db has about 10 users so should be ok. Thanks for your ideas. Nearly there I think


    Sent from my iPhone using Tapatalk

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The Db has about 10 users so should be ok.
    That is really not a safe assumption. If you have more than one user accessing it simultaneously, it is subject to corruption.

    If Security really is an issue for you, read this article: http://www.techrepublic.com/blog/10-...cess-database/

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Echoing Joe:

    Quote Originally Posted by andy49 View Post
    <snip> The Db has about 10 users so should be ok. <snip>

    Good luck with that!
    It is not a matter of IF is corrupts, just a matter of WHEN!

    Go ahead... ask me how I know.....

  8. #8
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Thx guys. I've split it and can't wait for first day back to start testing it


    Sent from my iPhone using Tapatalk

  9. #9
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    Must be split. Good to see you've done that. Can't recommend separate front ends. It is a viable choice of course technically. But then design changes must all be done multiple times for each front end - so while easier at first it becomes a real drag down the road.

  10. #10
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Must be split. Good to see you've done that. Can't recommend separate front ends. It is a viable choice of course technically. But then design changes must all be done multiple times for each front end - so while easier at first it becomes a real drag down the road.
    Really depends on how much they have in common. Most of the time when I have separate front-ends, they are for entirely different purposes and have very little in common (i.e. one is usually an off-hours job that updates data).

    However, if changes to queries, reports, or forms, it needn't be all that complicated or difficult to apply the changes to a few different front-ends. You can simply update one, and then go to the others and delete the one need to update, and then import the new version from the version you updated. You obviously would want to limit the number of different front-end versions you have to a manageable level.

    I guess it really all depends on many factors. I just know that Access Security isn't the greatest, and there are often ways around various parts of it.

  11. #11
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I've found a code which checks if the front end is up to date and if not, updates it. 10 front ends. All also teachers so not always easy to even get at their machines.


    Sent from my iPhone using Tapatalk

  12. #12
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I've found a code which checks if the front end is up to date and if not, updates it.
    That sounds pretty cool. Would you mind posting the link to that?

  13. #13
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    http://www.access-programmers.co.uk/...d.php?t=265491

    Needed some tweaking but was easy enough to follow.


    Sent from my iPhone using Tapatalk

  14. #14
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Thanks!!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-24-2016, 02:20 PM
  2. Replies: 1
    Last Post: 08-14-2015, 12:01 PM
  3. Replies: 2
    Last Post: 12-17-2013, 04:16 PM
  4. Replies: 3
    Last Post: 09-07-2012, 12:50 PM
  5. Replies: 2
    Last Post: 07-01-2010, 07:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums