+ Reply to Thread
Results 1 to 11 of 11

Entering Correct Username Displays Colour

  1. #1
    Registered User
    Join Date
    04-07-2007
    Posts
    8

    Entering Correct Username Displays Colour

    Hi i have a username and password textbox and i want to know when i enter a correct username the textbox it is in turns green and when wrong it will turn red, here is the code i have so far im not very experienced but know bits and pieces.

    Code for txtpassword.text

    Please Login or Register  to view this content.
    Code for txtusername.text

    Please Login or Register  to view this content.
    any help would be brill thanks.
    Last edited by lvlister2005; 04-11-2007 at 02:12 PM.

  2. #2
    Registered User
    Join Date
    04-07-2007
    Posts
    8
    Please someone must know.

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Are the text boxes attached to the sheet, or on a user form? Also, what type of text boxes are they (inserted from forms toolbar, controls toolbar, or picture toolbar)?

  4. #4
    Registered User
    Join Date
    04-07-2007
    Posts
    8
    They are on a user form and they have been inserted suing the insert menu in the developer section in excel 2007.

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    In which event handler procedure is this code written? Try this:
    Please Login or Register  to view this content.
    HTH

    Jason
    Last edited by jasoncw; 04-11-2007 at 06:37 PM.

  6. #6
    Registered User
    Join Date
    04-07-2007
    Posts
    8
    Thank you worked like a treat 1 final thing i was wondering how do you make the the first letter of a username be forced to be uppercase using the code you provided thanks again.

  7. #7
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Do you mean you want the first letter to change to upper case in the text box, or do you want VBA to recognize the first letter as uppercase for the tryUserName variable?

  8. #8
    Registered User
    Join Date
    04-07-2007
    Posts
    8
    I want the username to be uppercase is the tryusername variable,

  9. #9
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    This code will automatically create proper case in the text box itself:
    Please Login or Register  to view this content.
    This code will not change the case in the text box, but it will assign proper case to the variable:
    Please Login or Register  to view this content.
    HTH

    Jason

  10. #10
    Registered User
    Join Date
    04-07-2007
    Posts
    8
    Again very helpful thanks so much, have a good day!!

  11. #11
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    No problem. Glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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