Listbox not updating

Kenny Louden

New member
Local time
Today, 04:51
Joined
Oct 25, 2001
Messages
7
Greetings to one and all
I have a minor problem with a list box not updating that is driving me up the wall.
Here is what I have
I have a Form that has multiple pages (Tab control) and in one of the pages I have a list box that has row source of :

SELECT DISTINCT temp_wbs.Wbs_Element_No FROM temp_wbs LEFT JOIN my_wbsids ON temp_wbs.Wbs_Element_No=my_wbsids.Wbs_Element_No WHERE (((my_wbsids.Wbs_Element_No) Is Null)) ORDER BY temp_wbs.Wbs_Element_No;

The temp_wbs table is created after a user runs a process in a previous page, but when the user selects the page that has this list box – it is not updated with the current values from the temp_wbs table – it still contains old data.

However – when the user clicks a button on this page to delete their list (data from my_wbsids table) – the list box refreshes with the correct values from temp_wbs

What am I missing?
Any help in this matter is greatly appreciated
Thank you,
Kenny Louden
:confused:
 
Try a me.refresh or me.requery, at the end of your code
 
First – let me say thank you and most excellent suggestion :D
Second – I took your suggestion and expanded it to be
Dim ctlListBx As Control
Set ctlListBx = Forms!frmMasterForm!lstDefaultWBS
ctlListBx.Requery

This way I can guarantee that I am updating the correct list box

And Finally - <Slaps self on forehead> I should have thought to use the Refresh or requery method to begin with.. :o

Kenny
 
oops.. forgot to indicate that it indeed resolved my problem. Again thanks
kl
 

Users who are viewing this thread

Back
Top Bottom