+ Reply to Thread
Results 1 to 5 of 5

Text Box displayed value does not match real value

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    CA
    MS-Off Ver
    Excel 2003/2007
    Posts
    2

    Text Box displayed value does not match real value

    Hello,

    I have been noticing some strange behavior with some text boxes which are embedded in a worksheet.

    Say for instance I saved/closed the workbook with the value of "6" in the text box. When I re-open the workbook and change the value to something different, say "4", it will still display "6" whenever the text box is inactive.

    If you click in the text box and make it active, it will then accurately display the new value of "4". We use VBA to read the value of these text boxes using the following code:

    Please Login or Register  to view this content.
    The VBA code retrieves the correct value of "4", but it is very misleading to the user that the displayed value is "6" when the text box is inactive.

    Anyone else ever encounter this?

    Thanks!
    Kyle

    PS. It does this in both 2003 & 2007.
    Last edited by royUK; 10-28-2009 at 03:37 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Text Box displayed value does not match real value

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Added this time only

    Also, please say which type of textboxes you are using, maybe attach an example workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Text Box displayed value does not match real value

    Hello khott13,

    Welcome to the Forum!

    What type of text boxes are they: Forms, Control Toolbox, or something else?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    10-28-2009
    Location
    CA
    MS-Off Ver
    Excel 2003/2007
    Posts
    2

    Re: Text Box displayed value does not match real value

    Sorry about that, I'll be sure to mark my code in the future.

    We have noticed that this occurs for both Form and ActiveX control text boxes. It also only occurs to text boxes which have been read using VBA.

    Unforunately I can't send a version of the workbook for privacy concerns.

    -Kyle

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Text Box displayed value does not match real value

    Change the data, just leave the textboxes intact.

    beter still why bother with TextBoxes?

+ 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