+ Reply to Thread
Results 1 to 7 of 7

values not updating in userform

  1. #1
    Registered User
    Join Date
    05-20-2009
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    4

    values not updating in userform

    In Excel, I have created a userform where a user inputs parameters into various textboxes. A simulation runs based on these user entered values. All the VB code is in this form. There are some textboxes and charts that are supposed to get updated as the simulation runs so that the user can view the parameters change as the simulation happens (it is a "do loop").

    Everything is fine except the charts and textboxes don't display the most current value. They display the starting value during the "do loop " execution. Once the do loop quits, they then display the final values and chart.

    I have me.repaint and chart.refresh inside the do loop to display the most recent values. none work, as far displaying the most current values. Please help!
    Last edited by Raj_Ganguli; 05-22-2009 at 02:58 PM. Reason: solved -need to change tag

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: values not updating in userform

    You're showing the form modelessly?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-20-2009
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: values not updating in userform

    no. it's modal.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: values not updating in userform

    Screen updating is on?

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: values not updating in userform

    you will need to add a DoEvents command within the loop in order to let windows update and refresh the screen
    Cheers
    Andy
    www.andypope.info

  6. #6
    Registered User
    Join Date
    05-20-2009
    Location
    Alaska
    MS-Off Ver
    Excel 2003
    Posts
    4

    re: values not updating in userform

    Problem SOLVED, though not sure why.

    Some of the things I played with included changing form mode, ensure screen update was on (both based on shg's comments). However, in each case, it now works no matter whether the form is modal or not, and whether I comment out the screen update line.

    Didn't see Andy's comments until now so haven't tried it yet. I guess I won't since it working.

    Wasted 3 days on it and so it sucks the problem just went away without me knowing why or how. I realized while playing that if I move the window while the simulation is running (it is a serious number cruncher), the window gets blurry and update is no longer right. Maybe that's what was happening (my impatience to blame, combined with memory issue though I do have a Core Duo with lots of ram) .

    Anyway, if I will poke around and if I learn anything, I will be happy to update everyone.

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

    Re: values not updating in userform

    Can you mark the thread as solved
    Hope that helps.

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

    Free DataBaseForm example

+ 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