If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Frame_Click event mistakenly invoked when clicking ListBox
Scenario:
I have an option button group (unbound) which controls the recordsource property of a listbox control (for filtering). In the control group's Frame_Click event, the listbox.recordsource property is set when an optionbutton is clicked, and then the first row of the resulting recordset is selected in the listbox as follows: Private Sub Frame_Click() ListBox.Selected(0) = True Call ListBox_Click End Sub Problem: Upon subsequent clicking of the listbox control, the Frame_Click event is triggered, causing the first row of the listbox to be reselected. The result is an inability to select anything but the first row of the listbox. My question is, why does clicking the listbox control invoke the Frame_Click event? How can I prevent this event from executing when no click is performed? Many thanks, John |
#2
|
|||
|
|||
Frame_Click event mistakenly invoked when clicking ListBox
You should probably be using the After Update event of the
option group (not the Click event). Is the list box within the boundaries of the option group border? -- _________ Sean Bailey "JohnM77" wrote: Scenario: I have an option button group (unbound) which controls the recordsource property of a listbox control (for filtering). In the control group's Frame_Click event, the listbox.recordsource property is set when an optionbutton is clicked, and then the first row of the resulting recordset is selected in the listbox as follows: Private Sub Frame_Click() ListBox.Selected(0) = True Call ListBox_Click End Sub Problem: Upon subsequent clicking of the listbox control, the Frame_Click event is triggered, causing the first row of the listbox to be reselected. The result is an inability to select anything but the first row of the listbox. My question is, why does clicking the listbox control invoke the Frame_Click event? How can I prevent this event from executing when no click is performed? Many thanks, John |
#3
|
|||
|
|||
Frame_Click event mistakenly invoked when clicking ListBox
Thanks for your reply. The listbox is outside the frame border. I tried both
the AfterUpdate and BeforeUpdate events with the same result. When I click on an option, the Frame_[Event] is triggered. Then any subsequent clicking of rows in the listbox causes the Frame_[Event] to run again, after the ListBox_Click finishes. Beetle wrote: You should probably be using the After Update event of the option group (not the Click event). Is the list box within the boundaries of the option group border? Scenario: I have an option button group (unbound) which controls the recordsource [quoted text clipped - 17 lines] Many thanks, John |
#4
|
|||
|
|||
Frame_Click event mistakenly invoked when clicking ListBox
And there's no code in any of the list box events?
-- _________ Sean Bailey "JohnM77" wrote: Thanks for your reply. The listbox is outside the frame border. I tried both the AfterUpdate and BeforeUpdate events with the same result. When I click on an option, the Frame_[Event] is triggered. Then any subsequent clicking of rows in the listbox causes the Frame_[Event] to run again, after the ListBox_Click finishes. Beetle wrote: You should probably be using the After Update event of the option group (not the Click event). Is the list box within the boundaries of the option group border? Scenario: I have an option button group (unbound) which controls the recordsource [quoted text clipped - 17 lines] Many thanks, John |
#5
|
|||
|
|||
Frame_Click event mistakenly invoked when clicking ListBox
I do have code in the ListBox_Click event, but the behavior persists even if
I eliminate all ListBox event code. Beetle wrote: And there's no code in any of the list box events? Thanks for your reply. The listbox is outside the frame border. I tried both the AfterUpdate and BeforeUpdate events with the same result. When I click on [quoted text clipped - 13 lines] Many thanks, John -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200907/1 |
Thread Tools | |
Display Modes | |
|
|