andrewhh82
MIS
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.
I am using Access 2003
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.
I am using Access 2003