Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery Listbox

Status
Not open for further replies.
Oct 13, 2005
17
US
Hello. I have a weird problem. I have a listbox that is populated based on the selection made in a combo box. The row source of the listbox(lstCourses) is set to a query i've created. The code i've written is in the combobox's(cboName) AfterUpdate method.

Private Sub cboName_AfterUpdate()
Me.lstCourses = Null
Me.lstCourses.Requery
Me.lstCourses = Me.lstCourses.ItemData(0)
End Sub

When i select a new name in the combobox, it should requery the listbox. What is actually happening is the listbox just clears after i pick a new name. I've inserted breakpoints on all the lines above to try to see whats up and the weird thing is, when i have breakpoints in, it works! The listbox populates, when i remove the breakpoints, it doesn't! Thaks in advance if anyone knows whats up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top