+ Reply to Thread
Results 1 to 3 of 3

Trying to return userform after changing source - triggers TextBox Change event

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Trying to return userform after changing source - triggers TextBox Change event

    Userform F14_Risk1 has a command button that changes the format to view a different source of data. Everything works as should except when I try to reset the form to its original state. The Select Case event works using the CommandButton3 Caption as choice, but try as I might I cannot get form to revert. In the first case argument why isn't TextBox1_Change event but is if I try later in code.

    Basically I want the form to revert to the first Initialized state but ListBox1.Clear is throwing an error

    Any pointers appreciated


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nigelog; 08-09-2017 at 10:47 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Trying to return userform after changing source - triggers TextBox Change event

    The listbox cannot be cleared using .Clear when a RowSource is assigned to it. The code assigns a RowSource when "View Risk Assessment" is first clicked. To remove a RowSource, set it to a nullstring.

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Trying to return userform after changing source - triggers TextBox Change event

    Perfect AlphaFrog, first time I populated a listbox with a rowsource.....Thought because two column list "easy"

    Caught me for a long time

    Finished now...Many Thanks
    Please Login or Register  to view this content.

+ 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. cant keep typing in userform textbox after change event
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2014, 09:13 AM
  2. [SOLVED] Dynamic Range triggers Combobox Change event 3 times
    By natefarm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-25-2013, 10:51 AM
  3. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  4. Userform Textbox Exit Event to Run Application
    By baisty182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2010, 12:30 PM
  5. Userform textbox event that fires after I exit the textbox
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-04-2010, 08:08 AM
  6. Filter change triggers event?
    By ckiraly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2007, 03:54 PM
  7. Textbox Change event
    By Kerno in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2007, 05:08 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