+ Reply to Thread
Results 1 to 9 of 9

Use password text box and command button on userform

  1. #1
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Use password text box and command button on userform

    Greetings everyone!

    I have a problem that I hope you can help me with.

    I have a userform named Bldg_Search and on the userform there is a multipage strip which is named MultiPage1 which takes up half of the userform with four tabs labeled Page1 thru Page 4. My goal is to have a textbox named passfield and a command button labeled passcommand and its purpose would be to make visible Page 4 located on the multistrip. any code would be very much appreciated. I found some examples on the various sites, but none that did what I described above.

    Thanks again,
    David

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Use password text box and command button on userform

    .
    Here is a sample project using a three tab Multipage control on the userform.
    The third tab is normally hidden until the correct password is entered.

    The password for this project is: pw

    When using a multipage control remember that the first tab is referred to in VBA code as "0". The second tab is referred to as "1", etc. etc.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Use password text box and command button on userform

    I’ll give that a try. Thanks a lot! I will report back later.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Use password text box and command button on userform

    .
    If you only want the tab disabled and not hidden, use this code :

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Use password text box and command button on userform

    Your code works perfectly. However, when the userform is unloaded and then shown again, the contents of the text box is still there? Can you give me a code insert that will clear the textbox when the userform unloads?

    thanks,
    david

  6. #6
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Use password text box and command button on userform

    Thanks for your input and example. I will try out your example also just for practice.

    david

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Use password text box and command button on userform

    .
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Use password text box and command button on userform

    perfect! thanks

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Use password text box and command button on userform

    .
    You are welcome.

+ 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. VBA - Command Button, Userform, Username and Password
    By tramonroe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2016, 06:19 AM
  2. Replies: 2
    Last Post: 02-02-2016, 10:27 PM
  3. [SOLVED] Make flashing text in the command button in Userform
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2015, 12:40 PM
  4. [SOLVED] Filter and Export Data to CSV Text File With Userform Command Button
    By omagoodness in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2015, 11:18 AM
  5. [SOLVED] Populate Userform text box with command button in worksheet
    By STU22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2014, 11:32 PM
  6. UserForm: Command Button enters numeric value to text box
    By Gal403 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-07-2014, 12:01 AM
  7. [SOLVED] COmmand button requiring password, if password ok, unhide sheet.
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2012, 09:43 AM

Tags for this Thread

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