list contents disappear

M

Martin Folley

I have a list box where the row source is changed by clicking on a different
list box. This seems top work in that the choice in the first list box
produces a suitable list of options in the second listbox. The problem is
that when I click on the second box, the box goes blank ... all the the
entries disappear.

Clicking on the firs listbox again seems to re-populate the list normally.

I have added click, before/after update events for listbox2 that simply
debug.print. No output appears in the immediate box.

Where should I look for the problem?
 
M

Maurice

My guess would be that you requery the first listbox and that the second is
depending on the choice made in the first one. So maybe at the end of the
click event place a me.listbox2.requery as well? Where ofcourse you have to
replace the listbox2 name for the name of the listbox you are using.
 
M

Martin

Thanks for the reply.

In the Listbox1 code, after changing the rowsource of listbox2, I added the
listbox2.requery command, but this made no difference. When I change the
rowsource for list2, the contents of list 2 have always updated correctly.
Choose a different optoin in list1 and list 2 changes correctly again. This
suggests that list 2 is being populated correctly.

When List2 rowsource is changed and re-queried, the list2 listcount shows 8
items. At this point everything seems fine.

Click on List 2 however and the data goes. None of the code attached to the
click events, mousedown, before or after update is run. The click clears the
data but does not generate an event!

Additional info that I have discovered is that the message in List1 showing
the List 2 count is repeated with a count of zero. That is the code that I
inserted to test the List1 rowsource code is being run when I click on list2.
Is it possible for a control's events to point to the wrong code? I have
click event on List2 created via properties which is simply a debug.print,
however when clicking on List 2, my debug.print does not work but it appears
that my List1 code does!

Time to delete the control methinks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top