+ Reply to Thread
Results 1 to 3 of 3

Trying to lock a listbox IF another textbox value has IS BLANK

  1. #1
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    180

    Trying to lock a listbox IF another textbox value has IS BLANK

    Hi All,

    I am tying to lock a listbox (ufrmSession.lstlookup) based on if a textbox (ufrmSession.txtlookup) is blank. The below works if i don't click into the textbox (ufrmSession.txtlookup) but if i type in space, space etc it seems to recognize as if there is something in it!

    I don't wont that to happen. Any ideas? (Please find below the code i am using)


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Trying to lock a listbox IF another textbox value has IS BLANK

    Hi,

    Try changing the following line:
    Please Login or Register  to view this content.
    The Trim() function will remove leading and trailing spaces (and multiple spaces) from a string.

    Lewis

  3. #3
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Trying to lock a listbox IF another textbox value has IS BLANK

    thank you that's great!

+ 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. Lock or disable textbox
    By tanvi_kalra in forum Excel General
    Replies: 1
    Last Post: 03-01-2014, 11:30 AM
  2. Listbox to Textbox
    By Benjamin2008 in forum Excel General
    Replies: 6
    Last Post: 12-12-2013, 06:13 AM
  3. [SOLVED] Lock character during entry in UserForm textbox
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2012, 01:54 AM
  4. Replies: 2
    Last Post: 02-22-2012, 10:10 AM
  5. Excel 2007 : Unable to Lock Textbox in 2007
    By scottmalone in forum Excel General
    Replies: 3
    Last Post: 02-13-2009, 05:57 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