Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Excel cell in formula not refreshing answer cell | Excel Discussion (Misc queries) | |||
UserForm Listbox doesn't update | Excel Programming | |||
Refreshing a userform/listbox | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming |