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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox in subform problem 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I have a mainform(fmMain) with a linked subform(Data_Selected). I have a listbox in the subform which is multiselect. as soon as I click in the listbox, I get an afterupdate error message "object or class does not support the set of events", Even when the afterupdate event does not have any code in it.
If I clear the AfterUpdate Event completely the error disappears
If I replicate the listbox on the main form it works correctly.
I have dented my desktop banging my head in frustration! can any help before my desk disintegrates? TIA


'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
First can you compile and save all modules?

Secondly, are you overlapping any recordsources and rowsources with the same tables?

Thirdly, what afterupdate event? The sub form, the form, the listbox control or something else?
 
1) I can compile and save
2) No
3) the afterupdate is the listbox in question.
what is frustrating is the listbox works correctly if it is replicated on the main form but crashes out in the subform.
I thought at first it was the afterupdate coding that caused the error but when I deleted the coding, the problem still occured.
regards
Alan

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
If the row source of the listbox uses a parameter that references the form, try removing it and see if it helps.

If it works, there may be something odd with that. Honestly, I am making stabs in the dark hoping to catch something.
 
The stab in the dark hit the target. the problem was that when I selected the rowsource, I used the dropdown box to select the table (single item list). This time I invoked the query builder and this worked!
I can't pretend to understand the mechanics of it, all that matters is that it cleared the problem.
Many thanks for your input, I am very grateful

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top