+ Reply to Thread
Results 1 to 6 of 6

Can't get information to refresh/replace in a TextBox

  1. #1
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Can't get information to refresh/replace in a TextBox

    Hi All,

    I have the following code:

    Please Login or Register  to view this content.
    This is one of 8 codes which, when selection is made will populate TextBox5 with a specific code. This happens dynamically as opposed to an older method whereby I pressed a button.
    The problem I am experiencing is the information will not replace the previous option, but rather sit along side it. Is there an adaption that can be made to this code so If the user changed their mind, it would override the selection?

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't get information to refresh/replace in a TextBox

    How would it know to override rather than doing what you have now? I think you just need to reapply the same logic you used to populate the textbox initially, rather than messing about with the text that may already be in there.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't get information to refresh/replace in a TextBox

    Yes, I see, the code is still putting itself in the right area, right. So, why would it care, what's there already. I thought maybe there was a method that it would replace the contents that's in position 8 rather than sit along side it.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't get information to refresh/replace in a TextBox

    Your code takes the left 8 characters of textbox5, adds the first character from combo7 and then adds the remaining characters from textbox5. It's therefore always adding a new character. If you don't want to do that you should be using 10 and not 9 in the Mid function, assuming you always want to replace the 9th character no matter what.

  5. #5
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't get information to refresh/replace in a TextBox

    So do I need to be exploring this sort of thing:

    Please Login or Register  to view this content.

    the only problem with this is does indeed replace the letter, but deletes anything after it. What Im exploring is the possibility to replace an "X" with an "A" in the middle of a code without influencing the rest of the data.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't get information to refresh/replace in a TextBox

    That code takes the left 8 characters, adds 1, then appends the 10 characters from the 9th character of what was there originally.

+ 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. Refresh textbox content
    By boulay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2009, 10:00 AM
  2. Userform textbox refresh data
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2007, 10:57 AM
  3. [SOLVED] Refresh textbox to reflect scroll bars if appropriate
    By Jim May in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2006, 04:10 PM
  4. Refresh scenario information in a pivot table
    By Fin Analyst in forum Excel General
    Replies: 2
    Last Post: 03-30-2006, 12:20 PM
  5. Replies: 0
    Last Post: 12-14-2005, 10:44 AM
  6. Userform with 5 textbox and 1 needs to refresh to have total
    By funkymonkUK in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 10:06 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