A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Frame_Click event mistakenly invoked when clicking ListBox



 
 
Thread Tools Display Modes
  #1  
Old July 20th, 2009, 05:50 PM posted to microsoft.public.access.forms
JohnM77
external usenet poster
 
Posts: 2
Default 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  
Old July 20th, 2009, 07:31 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default 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  
Old July 20th, 2009, 07:46 PM posted to microsoft.public.access.forms
JohnM77
external usenet poster
 
Posts: 2
Default 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  
Old July 20th, 2009, 08:54 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default 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  
Old July 21st, 2009, 02:35 PM posted to microsoft.public.access.forms
JohnM77 via AccessMonster.com
external usenet poster
 
Posts: 17
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.