+ Reply to Thread
Results 1 to 20 of 20

How to create a password login through a userform

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    How to create a password login through a userform

    Hi, i'm trying to create a password login userform after clicking on the command button into a sheet.

    Firstly where i will be at the main page and i am suppose to click on the "staff access"
    Step 1.jpg

    Then a userform will be prompt and ask for password
    Step 2.jpg

    After getting the correct password, it will then move on the the specific sheet
    Step 3.jpg

    "StaffPage" (Sheet name for step 3)
    "txtPassword" (textbox for step 2)

    Sorry for the brief description
    Last edited by xia0jj; 01-07-2014 at 09:38 AM.

  2. #2
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: How to create a password login through a userform

    Try this..
    Please Login or Register  to view this content.

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    Something like this? I don't see any buttons on your "log in" form though.

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz, thanks for your help.

    However, there is an compile error (Method or data member not found) on this line

    Please Login or Register  to view this content.
    btw the staff access will be the button for the "log in"

    is it possible that i can include the userform on step 2?

    "UserForm5"
    Last edited by xia0jj; 01-08-2014 at 12:19 AM.

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    It is supposed to be in your userform's code, in this case UserForm5's code.

    You need to create a button though.

  6. #6
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Is it possible that i can use the "staff access" as the prompt for userform, then it will redirect me to the "staffpage" after the password in inout correctly.

  7. #7
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    If you want to prompt for password directly upon clicking of "Staff Access", you should try moonsaga's solution.

    What I provided was more for: Click "Staff Access" -> Open UserForm5, enter PW and click button.

  8. #8
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    yes, what i wanted was "staff access" -> open UserForm5, enter PW and click button -> "staffpage"

    Sorry for the late reply btw.


    Do you mean the command button like this
    123.jpg
    Last edited by xia0jj; 01-08-2014 at 08:34 AM.

  9. #9
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz, i just understood what you meant earlier on and i have added a command button. But nothing happens after i click enter.
    Last edited by xia0jj; 01-08-2014 at 10:04 AM.

  10. #10
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    What's not working? The code in post #3 should go into UserForm5's code. Make sure the name of the Sub is correctly changed to the name of your "Enter" button too.

  11. #11
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi millz, i have put the coding into the designated command button. but however i don't get any respond after click enter.

    I apologize for the late reply.
    Last edited by xia0jj; 01-09-2014 at 12:08 PM.

  12. #12
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    Can't really tell what's wrong. Maybe attach a sample workbook.

  13. #13
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz,

    This is the screenshot of my main page
    MainPage.jpg

    And this is the screenshot of the UserForm5 which is the login page
    UserForm5.jpg

    and in the command button "Enter", the codes are input from what you gave me.
    Please Login or Register  to view this content.
    However there is no error but i get no respond after click the enter even the textbox is blank or not.

    once again, sorry for such a brief description.


    And is it possible that i can prompt a "incorrect password" textbox when the password is input incorrectly then return it back to UserForm5?
    Last edited by xia0jj; 01-10-2014 at 03:05 AM.

  14. #14
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    Hi xia0jj

    I see no problems, I've also tested the code myself, it works fine. Since you are facing a weird problem which I can't replicate on my side, I asked you to attach a sample workbook. But you gave more screen shots instead.

    You get no response because you:
    -left PW blank
    -typed a wrong PW

  15. #15
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz, i don't think i can upload my workbook onto this forum. How bout i send you through your personal email?

    And i get no respond regardless i leave it blank or type anything into the textbox

    Lastly, i would like to apologize for my dumbness.
    Last edited by xia0jj; 01-10-2014 at 04:44 AM.

  16. #16
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    Hi xia0jj,

    To upload a workbook, click "Go Advanced". Click on the paper clip icon and choose your file to be uploaded.
    Please make sure you remove/replace any sensitive/confidential information before uploading.


    Regarding the code, just in case you haven't noticed, there are really no code for a wrong/no password entered. Only code for jumping worksheet and closing the form if a correct password is provided. The correct password is "YourPassword" if you haven't changed it.
    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz,

    Ohmygod, it was a terrible mistake that i mislooked the 'P'.
    Everything seems to work fine now.

    But is it possible that i can prompt an incorrect password pop up when the password is input wrongly?

    Here is an attached of my workbook
    Automation.xlsm

  18. #18
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    Hi xia0jj, since it's working, I wouldn't need to look at your workbook anymore.

    If you want a message shown on wrong password just add in MsgBox.
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    01-06-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: How to create a password login through a userform

    Hi Millz, I believe I'm done with this part.

    Really a big thanks to you and I'm terribly sorry for the miscommunication we had earlier on.

  20. #20
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to create a password login through a userform

    No problem, all's well. Mistakes happen.

    Good luck with your project

+ 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. username and password login
    By dc123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2013, 08:38 AM
  2. Ho to set Password Login for Workbook
    By AGrace in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2012, 02:11 PM
  3. excel Web query with login and password
    By ljoseph in forum Excel General
    Replies: 0
    Last Post: 09-16-2010, 08:39 PM
  4. [SOLVED] Saving ftp login password ?
    By Gershon Shamay in forum Excel General
    Replies: 0
    Last Post: 04-18-2005, 03:06 AM
  5. Lotus Notes Login password
    By d_h_sanjay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2005, 05:20 AM

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