Trouble finding the right event

P

Ptero

I have a 'switchboard' type form with a subform. There are 5 lists of options
grouped by functionality which when one is clicked change the sourceobject of
the subform. There are about 80 different choices and this method enables me
to navigate quickly between all of the options rather than going up and down
a menu tree. In principle it works well.

My problem is that having changed the sourceobject, accessed the subform and
taken whatever action is required I then want to select another option, so
click on an option in a different group. What I am struggling to find is the
event which will alow this to happen.

What seems to happen is that the first time I click on the option, nothing
happens but on the second click the sourceobject is changed and I am
redirected to the subform as required. At the moment I am using the onclick
event and it works no differently with afterupdate, got focus, on enter and
mousedown events. So I have to do two clicks (not a doubleclick) where one
should do.

If I use the mouse move event (to change the font weight) this is triggered
when the mouse moves over the relevant control.

It is as if when leaving the subform or a different option group and first
clicking on one of the options an event is not generated.

If I have to live with two clicks then so be it, but it would be more
pleasing to find a solution.

I am using Access 2002 and have tried in in 2003 with the same result.

Has anybody any suggestions?
 
A

Arvin Meyer [MVP]

Remember, clicking on a choice within an Option Frame, triggers the event
for the frame, not the option. So you may want something like (aircode):

Sub MyOption_AfterUpdate
Me.SubformName.SourceObject = Me.MyOption
End Sub

Remember too, that options in an Option Frame are Integers, so you'll also
need to change the value to a string value that is the name of a subform
(not subform control)
 
P

Ptero

Hi Arvin,

Thanks for the response, I'm actually using a listbox rather than an option
group (this is populated by using a query on MSysObjects to find all forms
starting with a particluar set of characters). I am already using the code
you suggest to change the subform and this is working fine.

The problem is when 'returning' to the main form, clicking on any control
other than the original 'calling' control does not appear to generate an
event.

To put it another way, if you have a form with two list boxes and one
subform. By clicking on one of the lines in either of the list boxes, the
code (as you suggest)runs and the subform sourceobject is changed. If you
click on any other line in the same list box the subform sourceobject will
change again. However if you click on a line in the other listbox instead,
nothing happens - you have to click again to trigger the event.

From a use point of view you effectively have to click on a list to select
it and then again to trigger the event. All I want to do is click once!

Any thoughts?
 
P

Ptero

Hi Arvin,

I actually have 5 list boxes and don't know which one the user will be
clicking on.

From what I can determine, the subform on exit event is triggered when I
click on any of the listboxes - and the second time I click on a listbox the
gotfocus event for that listbox is generated. What I need to be able to do is
have the on exit event trigger the appropriate gotfocus event for the list.
i.e. so user only clicks once

I have tried using the mouseover event on the listbox to set the focus but I
get the following error message "development system can't move the focus to
the control Open0".

Many thanks for your assistance

Regards

Ptero
 
P

Ptero

Perhaps my form has become too complicated - I'll try creating a simpler form
and see if that will work
 

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