+ Reply to Thread
Results 1 to 6 of 6

Excel Userform Multi Level Login

  1. #1
    Forum Contributor
    Join Date
    04-14-2017
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    148

    Excel Userform Multi Level Login

    Good Day

    I have this Excel Userform, whereby two difference Departments are logging in to amend records.

    The login box consists of two Textboxes - username and password.

    When the user Logs I would the userform to protect(grey out) certain Textboxes and Menu buttons based on their Username.

    Example:

    Username: John
    Password: 123
    Department: Finance

    Username: Jack
    Password: abc
    Department: Credit

    If John logs from Finance, TextBox1 and TextBox6 must be disabled of hidden

    If Jack logs in from Credit, TextBox1 and TextBox6 must be enabled however TextBox2 and TextBox8 must be disabled or hidden

    Currently I am using two userforms to achieve the above which is not ideal.

  2. #2
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: Excel Userform Multi Level Login

    Create a Boolean reference, which is marked True/False depending on the login, and then use the True/False to enable/disable the boxes.

  3. #3
    Forum Contributor
    Join Date
    04-14-2017
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    148

    Re: Excel Userform Multi Level Login

    Hi Kremxel

    Can you please provide a sample code for the Boolean reference
    thanks

  4. #4
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: Excel Userform Multi Level Login

    Without seeing your current code and because i'm writing on my mobile on a train with intermittent connectivity I've created the pseudo code below for illustration purposes that should help,

    in a module
    public bFinance as Boolean


    Please Login or Register  to view this content.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel Userform Multi Level Login

    Hello farhadj,

    It is a good idea to attach a sample workbook, so that we can see what you have and how it could be solved.

    Please look at the attached sample Workbook, and see if you can change it to suit your requirements.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Excel Userform Multi Level Login

    One other idea: set the .Tag of each control to tell which department it should show for.

    For example, if one TextBox had the tag "credit" another "finance" and another "credit&finance" you could use a loop like


    Please Login or Register  to view this content.
    Note that all the common controls (like the Close Button) would need to have a .Tag like "credit&finance"
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multi-level pop up box in excel-vba
    By Donpaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2017, 02:12 AM
  2. Multi-level Userform login Issues - Cells not remaining protected.
    By Chardo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2014, 12:35 PM
  3. [SOLVED] Multi-level menu or combobox in Excel 2007
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2013, 09:24 AM
  4. Bill of Materials conversion from multi level to single level
    By susmitpatel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-11-2013, 12:53 AM
  5. Multi level numbering / bullets in EXcel
    By claoker in forum Excel General
    Replies: 3
    Last Post: 02-11-2010, 07:05 PM
  6. Using macro to convert single level BOM to Multi Level BOM
    By andrew_chong in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2006, 04:57 PM
  7. [SOLVED] Multi-level Subtotals with Excel 5.0 data
    By Sandy M in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2005, 09:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1