Subform Focus Issue

  • Thread starter Thread starter Bob Howard
  • Start date Start date
B

Bob Howard

Using Access 2000, I have a form with a subform. As the user scrolls
through the table bound to the main part of the form, I will occasionally
want to disable/lock the subform's fields since I don't the user to be able
to touch those fields (controls) for certain records on the main part of the
form. The main part of the form and the subform are related via their table
relationships.

Here's the problem. If the subform's focus happens to be on one of those
controls, I get a "focus" error when I disable/lock the controls. Since I
want to be able to lock every control on the subform, I had no place left to
move the focus.

Since I was unable to find any way to remove the focus entirely but only to
set it somewhere else, I created a "dummy control" on the subform that's
borderless, enabled, visible, and with the same color as the background ---
so the user cannot even tell it's there. I move the focus to that dummy
control.

Is this the only way to do this or I am I missing something?

Bob (@Martureo.Org)
 
A dummy "focus-catcher" is certainly the most common (and the only way I'm
aware of, but that's not to say that there's not another) way of dealing
with this problem on a form. If the form is a sub-form, you have the
alternative of setting the focus to a control on the parent form, rather
than to a focus-catcher on the sub-form itself.

Rob
 
Regarding setting the focus on a control on the parent form....

I thought I tried that once before in a different application but was still
getting some sort of error, so I simply assumed that each (both the parent
form as well as the subform) had its own focus --- I guess I was incorrect
as this would have meant there were two "focuses" --- I guess that's not
possible.

I'll give it a try.

Bob.
 
Back
Top