+ Reply to Thread
Results 1 to 5 of 5

TextBox - Removing Values in Textbox upon click

  1. #1
    Registered User
    Join Date
    05-16-2019
    Location
    Dudley, England
    MS-Off Ver
    2016
    Posts
    11

    TextBox - Removing Values in Textbox upon click

    I have a TextBox which is being used for entering a Username and I figured let's put in an instruction to Enter the Username there:

    Please Login or Register  to view this content.

    However when the User clicks on the button it does not remove 'Enter Username' and so this could cause confusion.
    I tried to enter this in the 'GotFocus' bit but this doesen't work:


    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    16,841

    Re: TextBox - Removing Values in Textbox upon click

    Add this line of code: me.requery

    and see if that works for you.

  3. #3
    Registered User
    Join Date
    05-16-2019
    Location
    Dudley, England
    MS-Off Ver
    2016
    Posts
    11

    Re: TextBox - Removing Values in Textbox upon click

    Thank you Alan, I add it before the line of code in GotFocus and it said 'Method or Data Member Not Found'


    (I'm doing this in Excel)
    Last edited by Steve1977; 11-14-2019 at 12:17 PM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    18,922

    Re: TextBox - Removing Values in Textbox upon click

    How about this trick using 2 textboxes.
    The message is displayed in the lower box and removed once text is entered
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    05-16-2019
    Location
    Dudley, England
    MS-Off Ver
    2016
    Posts
    11

    Re: TextBox - Removing Values in Textbox upon click

    Brilliant stuff, that's exactly what I want it to do, I see there's code in Initialise and Change so will apply that to mine now

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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