Subform Focus Issue

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)
 
R

Rob Parker

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
 
B

Bob Howard

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.
 

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