Event Timing Problem?

D

DS

I have a Listbox on a Subform,it is updated everytime the subform gets a
new record or a record is changed. Also when I click on the ListBox it
moves the Subform to the corresponding record. The problem is that
after I select something in the listbox the selected row remains
highlighted. Now whenever I go to add a new record from another list on
the main form to the subform I have this code that clears the selection
from the subforms listbox, but....it also fires the event that I have on
OnClick which moves the subform to the corresponding record, but this
sends an error message because now nothing is selected. Here is the
code that clears the selection on the listbox that is fired from the
listbox on the main form.

While
(Forms!Buttons.PrepSlipSub.Form!List52.ItemsSelected.Count > 0)
Forms!Buttons.PrepSlipSub.Form!List52.Selected
(Forms!Buttons.PrepSlipSub.Form!List52.ItemsSelected(0)) = False
Wend

So how can I clear the selection from the listbox without having this
problem?
Thanks
DS
 

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