Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2009
    Location
    Philadelphia, PA
    Posts
    2

    Smile Unanswered: Help with Login Form

    I added the login form provided at Creating a user login form | Database Solutions for Microsoft Access | databasedev.co.uk to my database.

    It works great, Love it! I would however like to create a different switchboard for each user, thus limiting what forms and reports each user has access to.

    Can anyone show/tell me how to do this?

    Thanks!

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Store a global variable of the user's ID (or userlevel) and then code your switchboard to be sensitive to it.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Oct 2009
    Location
    Philadelphia, PA
    Posts
    2
    I am actually new to all of this. I really do not know VB and not enough to know how to code it.

    Right now this script sends you to one specific switchboard. I would like to be able to designate that user 1 goes to switchboard 2, user 3 to switchboard 4, etc.

    Just thought there would be an easy line of code that could do this.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Change your user table to include a field for the name of the switchboard you wish the user to access.

    Then when someone successfully logs in, query to get this value and then you can decide which form to open.

    Consider DLookup() to obtain the value
    George
    Home | Blog

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Quote Originally Posted by Phillytomster
    I added the login form provided at Creating a user login form | Database Solutions for Microsoft Access | databasedev.co.uk to my database.

    It works great, Love it! I would however like to create a different switchboard for each user, thus limiting what forms and reports each user has access to.

    Can anyone show/tell me how to do this?

    Thanks!

    I prefer to do everything automatic (after all, why make users enter in a loginID and password AGAIN when the Windows loginID can be grabbed automatically in code and then utilized throught the code as well as for the user's permissions.) I can simply enter =GetUser() as the defaultvalue for any field and it will put in the current user's loginID automatically. It's a great way to return records only that specific user entered (or modified if you have that field as well.)

    Here's the link if you're interested: http://www.dbforums.com/6332819-post68.html

    The above way would allow you to create a SQL Statement to populate in your form which matches the 'EntereBy' field with the =GetUser() routine and would give you your recordset based on who is logged in. You can also use it to direct your code to different forms. You'd also want the 'EnteredBy' field in the table to default to =Getuser() when adding new records so you can apply the criteria. I'd make the EnteredBy field a required field (Text type, 50 characters). On the form, for this field, set the DefaultValue = GetUser() and it will write in the users login automatically. Note: It's also good to have a DateEntered field (date/time) defaulting to Date() on the form.

    Users tend to get tired of always entering/remembering another login/password.

    I'd also avoid the switchboard! You don't want your main form that has all the buttons to be tied directly to a table. Create the buttons manually instead on a form without a recordsource. I've seen many problems with the switchboard in a multi-user environment.
    Last edited by pkstormy; 10-11-09 at 05:52.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Quote Originally Posted by Phillytomster
    I am actually new to all of this. I really do not know VB and not enough to know how to code it.

    Right now this script sends you to one specific switchboard. I would like to be able to designate that user 1 goes to switchboard 2, user 3 to switchboard 4, etc.

    Just thought there would be an easy line of code that could do this.
    Well, ... there's not ^^

    These kinds of comments just make me want to say "hire a consultant then".
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Have a look at my posting at this link How to create user login form (MS Access 2000 - 2003) - Database Journal Forums message 44 or 45 from memory will give an example of your requirements.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •