Results 1 to 7 of 7
  1. #1
    nachiketdp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2016
    Posts
    3

    VBA code to automatically load relevant switchboard based upon the user

    Dear all,

    I'm using MS Access 2010. I've created a file wherein I've created a form for a user login with password. I've created different switchboards for different users. I also have a users table against which I've mapped switchboard IDs. Now I want to write a macro so that once the user enters his user id followed by password, the file should automatically load the switchboard relevant to the user.

    Thus I will be able to define different levels of users having different types of rights to work within the database.



    However, I am not able to properly write code for the same. Presently, it only loads the default switchboard irrespective of the user. Can someone help me? I can email the file to you for complete reference.

    Any help will be highly appreciated!

    Thanks & Regards,
    Nachiket Pendharkar

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Now I want to write a macro ....However, I am not able to properly write code for the same
    I don't use macros (except for AutoExec) so I can't help with that. I do write code though. Your comments confuse me as to which one it is you want.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    I myself would not use the switchboard for something like this - and instead design a generic starting screen. But in any case the switchboard functionality is defined by the table as its record source - so your challenge is managing the data that drives the switchboard form. For most objects the solution would be to source it on a query and then use a query criteria to have differing data depending on User ID. However it may be that the switchboard will only drive from its table - I am not sure because I do not design with it. Check to see if the switchboard can be resourced to a query. If it cannot and must be sourced to its table - then you will need to dynamically clear/write data to its table. The table of course must be local in the front end and not shared in the back end if this is the case.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I guess that would depend on whether or not the poster used the built in switchboard functionality or created their own. Fortunately I didn't go to the trouble of coding for this since I was presuming the latter. I was going to offer that if there is a limited number of user profiles, another approach would be to control which controls are visible to the user based on their user permissions level. This only requires one form, but is not relevant to the topic of multiple forms created by the switchboard manager.

  5. #5
    nachiketdp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2016
    Posts
    3
    Thanks NTC and Micron for your replies! I am not very fussy about switchboard. Either that or something else is going to help me, then I am ok with it. My objective is as follows:

    1) I've created multiple forms and reports
    2) Depending on the user type, I would like to selectively display the list of forms and reports available. At the very least, even if all forms and reports are visible, atleast the user should not be able to access all of it. What he can do and what he can't, should depend upon his user type.

    Do you have any ideas how this can be achieved?

    Thanks in advance!

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    nachiketdp,

    You might want to research/google role based access control
    There are several papers and slide presentations that deal with the concepts involved.
    This is something that requires planning and design, and may be overkill for your application.

    Good luck

    cross posted http://www.utteraccess.com/forum/ind...ic=2038037&hl=

  7. #7
    nachiketdp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2016
    Posts
    3
    Thanks for your inputs, Orange. Will check that.

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

Similar Threads

  1. user security access 2013 for switchboard items
    By LaughingBull in forum Access
    Replies: 5
    Last Post: 08-04-2015, 04:08 PM
  2. Replies: 1
    Last Post: 12-17-2014, 10:30 AM
  3. Replies: 4
    Last Post: 10-09-2014, 12:25 AM
  4. Load a Linked table into front end when switchboard starts
    By smeghead67 in forum Import/Export Data
    Replies: 5
    Last Post: 02-08-2013, 03:32 AM
  5. Replies: 8
    Last Post: 07-27-2012, 12:23 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