+ Reply to Thread
Results 1 to 5 of 5

Check multi level username with password

  1. #1
    Registered User
    Join Date
    09-19-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    5

    Check multi level username with password

    Dear all,

    Need help for you guys. I face a problem for my login page. This coding is I find on youtube therefore I need your great helps. When the user select the username and input their password, it will login in and it will store in the login log which is sheet 2 and will give the user form right according to the user setting.

    1. is there any other ways to input the username into the combo box?
    2. How should I do the coding if I want the user to select the username, then the department will be auto show up.
    3. Is it possible to have a progress bar when password is correct?

    Thanks again for all your great helps.
    Attached Files Attached Files
    Last edited by Shunwen82; 09-27-2015 at 11:36 AM. Reason: Change title to fit under the forum rule

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Problem with the coding

    Hi, to get faster and better answers it's best to adapt your thread title as per forum rules

  3. #3
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Problem with the coding

    Thank god you use option explicit.
    It's unclear to me what you actually want to do, but here's why your code errors out:

    In the macro btnProcess_Click, change the following:
    Please Login or Register  to view this content.
    This should be:
    Please Login or Register  to view this content.
    Next up - you've got the following line in your code:
    Please Login or Register  to view this content.
    but you don't have the label errHandler anywhere. Remove this line.

    Next up, in the following line you define the variable 'Code' as Clng, but that will error if the user inputs a password that isn't numerical.
    Please Login or Register  to view this content.
    Solution would be to either remove the CLng or change your textbox to only allow numbers.
    (I think removing CLng would be easier for you )

    Next up - you define a VBA function (MsgBox) as a variable.
    Please Login or Register  to view this content.
    While that's not technically impossible, it's very bad practice. Change the name of your variable here into something like MsgBx

    But better still, remove the variable setting above entirely and remove the "=" from the two lines below:
    Please Login or Register  to view this content.
    Then, this macro will run without errors.
    However, it really seems like you are not very sure of what you're doing and I have my sincere doubts that this code will actually (ever) do what you aim to do, so perhaps it's better to start from scratch and tell us exactly what it is you're looking to accomplish with this sheet.

    As for your other questions:

    2. How should I do the coding if I want the user to select the username, then the department will be auto show up.
    Honestly, I can explain this to you, but it wouldn't help much as long as your code is still such a mess...

    3. Is it possible to have a progress bar when password is correct?
    Yes. But progress bar for what? There's no additional code that runs, at least nothing that I see that would require a progress bar, so it doesn't make sense.
    Please click the * below if this helps

  4. #4
    Registered User
    Join Date
    09-19-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    5

    Re: Problem with the coding

    Hi JasperD, Sorry as I know my code is in a mess. This is my first time doing it. For my project, I'm helping my father to keep track on the complaint that so that he can have better view on the issue.

    May I know do you have any better solution for me to read through? After I try to edit as states above, there is no error but it cannot bring me to the next page that I want after I press the process button.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,599

    Re: Problem with the coding

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

+ 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. Coding Problem
    By Shazz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2012, 03:55 AM
  2. Coding Problem
    By skin.uk1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2011, 11:38 AM
  3. If, Then, Else Coding Problem
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2006, 03:30 PM
  4. Problem with coding a msgbox
    By Jacqui in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2005, 06:20 PM
  5. [SOLVED] problem with coding
    By Subs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-26-2005, 11:05 AM
  6. Please help: Coding Problem
    By Tim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2005, 01:05 AM
  7. [SOLVED] Coding problem
    By John in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2005, 01:05 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