Results 1 to 5 of 5
  1. #1
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662

    Display relevant buttons for particular user based on Login

    Suppose, I have a Login Form - 2 ways
    1) Store UserID & Password in table & then check the values entered in Login Form against them & allow access to the db. ( IMO - Should avoid this but has advantage of simplicity in adding new users )
    2) Use VBA Code hard coded with the User Name & Password & probably not accessible once converted to ACCDE.

    Am I wrong in choosing Option 2 in the above or are there better ways than the above two?

    Next :
    Say there are 2 users User1 & User 2.
    I have a kind of SwitchBoard Form ( with say 2 buttons, Button 1 & Button 2 ), which is opened automatically, once the User logs in.

    I need some guidance with this :
    User1 on logging in, should be able to see only Button1 on the SwitchBoard Form
    and
    User2 on logging in, should be able to see Button1 as well as Button2, on the SwitchBoard Form.



    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    In my db, I capture the user ID from the network login. I accept that if user has logged into the network, they are valid user. I only need to know who the user is so their ID can be saved with some records. Code looks for user in Users table and if not found they are a new user and the 'login' form opens for them to input their initials. A new record is created with default permission of 'staff'. They never see the 'login' form again. There is no password verification. I have taken steps to make it hard for users to accidentally 'mess up' the database but any knowledgeable Access user could thwart those measures. The db is vital to our operation but we trust that no one will damage it beyond repair and we have backups. This data is not of personal or confidential nature so there is little concern about it getting distributed. If you want to examine db, download from https://app.box.com/shared/r8nea07sng
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    @June,
    Downloaded the file, but LabData opened & showed me a lot of tables & queries. MaterialsDatabase did not open. It threw up error "Materials Lab Database can't run the macro or callback Function "OnRibbonLoad". There was another script file, which I was beyond me.

    That apart, I'll explain the functional scenario at my end, which I had not done earlier.
    It is a simple Single User Desktop Application. It is going to be used by a single employee.
    It contains the clients ( lots & lots of them ) contact details.
    The switchboard has certain buttons, which are useful only for Data Entry Forms.
    It also has a certain button, which display the entire Organization's Clients List with the Contact Details. It is this button, which should be accessible to only an authorized person & should not be visible in the Data Entry Operator's Screen, post Login.
    In short,
    Switchboard should display limited ( relevant ) buttons to the Data Entry Operator
    and
    Switchboard should display other limited ( relevant ) or All buttons to the Authorized Person & these should not be seen by the Data Entry Operator,
    even though SwitchBoard has all the buttons.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Hold down shift key when opening my db frontend so the opening code won't run. Can examine objects and code but won't run properly without a couple of changes. First of which is to reset table links. Your profile says you are in Access 2000 but you must really be running later version for the frontend to get as far as it did. Next step would be to create a record for yourself in the Users table classified as Admin user. I don't know why the ribbon code fails, it should work in Access2007 up.

    So the login/password is to counter any attempt by other persons to get to the data. Login/Password on the frontend won't prevent that. If anyone knows location of the backend, they could just go straight to that file and do whatever they want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    @June,
    Pls accept repeated " Sorry for delayed response ", as I am a bit away these days from the net.
    Do not know about db not opening in versions. I usually use my friends comp to fiddle with dbs & it works on it. He had an older machine earlier. Have just managed to get a laptop, but it unfortunately has Ubuntu as OS with Libre Office. I can manage to open dbs, but don't get the functionality of windows & ms office ( teething problems ) for working with them. Still need to get a hang of things.
    Here's what I have decided to do :
    1) Person opens accde file ( Have decided against Splitting DB, as it is a simple single user desktop application ).
    2) Log in Screen Comes.
    3) Person enters userid & password.
    4) Depending on UserID & Password, the Data Entry Operator is taken to Navigation Panel 1 ( Switchboard 1 ) or if it is the Authorized person who has logged in, he / she is taken to Navigation Panel 2 ( Switchboard 2 ).

    Thanks

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

Similar Threads

  1. Replies: 13
    Last Post: 10-02-2014, 09:29 AM
  2. User Login That Disables Certain Buttons
    By neuhur in forum Access
    Replies: 7
    Last Post: 02-10-2014, 12:28 PM
  3. Replies: 1
    Last Post: 11-23-2011, 08:24 AM
  4. Display user's database or record after login
    By stoey in forum Programming
    Replies: 13
    Last Post: 09-15-2011, 11:18 AM
  5. Enable command buttons based on login
    By foxtet in forum Security
    Replies: 3
    Last Post: 07-26-2011, 05:11 AM

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