Subform field focus

J

Jackie L

Does anyone know a way around the "feature" which leaves the focus of a
subform on the same field if the mouse is used to click on a field on the
main form?

I have a main form and a subform. When the user clicks into the second
field on the subform (it is not a tab stop and they use their mouse
constantly) and then clicks on the main form, the focus on the subform
remains on the second field eventhough it is not a tab stop. I have tried to
change the focus on the OnLostFocus of the subform and in many other places
with no luck.

Any suggestions?
 
M

MikeJohnB

Does this happen if they are in any other Control on the subform? Does this
happen on all controls on the main form? (Try clicking in each one). Can you
tab out of the Control2? Is there any code associated with the On lost focus
event of Subform Control2? if so, please post it.

I cant think of anything else at the moment.

Regards
 
J

Jackie L

There are only two controls on the subform, Field1 is the tab stop, Field2 is
not a tab stop but that is the field they click into before clicking back on
the main form to select a new record from a drop down.

When they then tab into the subform, it goes to Field2. I have put set
focus code on the got focus of the subform, on the lost focus of the last
field on the main form, etc. This is a characteristic of Access. I am just
looking for a way to get around it.

Thanks,
Jackie
 
M

MikeJohnB

Mmmmm, I have similar situations with subforms and main forms transferring
focus from one to the other and back again but without this issue. I can only
suggest you check the on got focus event of the main form controls to check
if thay are passing focus back to the subform in a place you have not thought
about or forgot to clear from development mode. What happens if you comment
out the code which passes the focus to the subform on the last controls lost
focus event. What happens if you comment out the on got focus event of the
subform? You can always remove the comment ' once you have verified if there
is or is not a problem.

Sorry I cannot help further.

Regards

Mike B
 

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