Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TDW TDW is offline
external usenet poster
 
Posts: 18
Default Listbox not refreshing on update

Hi There,

I have a form with a multicolumn listbox and text boxes corresponding to the
columns of the listbox. I also have 'Insert', 'Update' & 'Delete' buttons
that are used to maintain the list in conjunction with the textboxes. I am
using the listbox_Change event to keep the textboxes and listbox synchronized.

My issue is this: when I insert new items into the listbox it doesn't always
display the list correctly. Suppose the list currently has "Item1, ...,
Item5, Item7". I will insert 'Item6', the listboxes will display Item6 but
the list will show two of Item7. If I scroll through the items in the
listbox, it will correctly display the list items in the textboxes; but, the
listbox will continue to show two of Item7. If I continue to scroll up and
down through the list, the listbox will eventually 'refresh'(?) and start to
show the correct list.

What gets me is that internally the list is clearly OK as scrolling through
the list always generates the correct values being displayed in the
textboxes. It's as if the listbox control needs some time before the
'displayed' list matches the 'internal' list.

Any thoughts, suggestions would be greatly appreciated!
Thanks,
tdw

--
Timothy White
Contract Programmer
Ontario, Canada

<my initialshite<atsympatico<dot<countryCode

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Listbox not refreshing on update


Hello Tim,

Try adding Repaint into the update code.

UserForm1.Repaint

This should solve the problem. Change UserForm1 to match your Form's
anme.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=558891

  #3   Report Post  
Posted to microsoft.public.excel.programming
TDW TDW is offline
external usenet poster
 
Posts: 18
Default Listbox not refreshing on update

Hi Leith,

Thanks for the suggestion!

Unfortunately, that doesn't work. At some point (it doesn't happen every
insert and I haven't yet noticed a pattern when it does happen) when I insert
into the list I still see a duplicate item in the list box; but, the correct
list of unique items in the text boxes. If I scroll the list box a couple of
times it seems to sort itself out and begin to show the correct list; but,
again, it isn't always immediate.

My biggest fear with using the Repaint was that the form would flash.
Fortunately, that doesn't appear to be the case. I just wish the listbox
would refresh
--
Timothy White
Contract Programmer
Ontario, Canada

<my initialshite<atsympatico<dot<countryCode



"Leith Ross" wrote:


Hello Tim,

Try adding Repaint into the update code.

UserForm1.Repaint

This should solve the problem. Change UserForm1 to match your Form's
anme.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=558891


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Excel cell in formula not refreshing answer cell Johnny Excel Discussion (Misc queries) 2 June 21st 07 05:49 AM
UserForm Listbox doesn't update befar Excel Programming 1 May 23rd 06 01:05 AM
Refreshing a userform/listbox toocold[_11_] Excel Programming 3 April 3rd 06 09:07 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"