R
Robert Nolty
Hi all --
I have a subform on a form which is invisible most of the
time. When it is needed, it becomes visible. The user
edits a field or two and clicks a "DONE" button. At that
point I want the subform to become invisible again. The
problem is, as the user pushes the DONE button the subform
has focus, and I get an error trying to make the subform
invisible while it has focus. So I tried to use VBA to
move focus to a control on the parent form, but I keep
getting runtime errors saying "Access can't move the focus
to xxx". I'm guessing that SetFocus only works for
controls on the form (in this case subform) that currently
has focus. I also tried moving focus to the parent as a
whole,
Me.Parent.SetFocus
but, according to the documentation and I guess this is
what I see, that just gives focus to the last control on
the parent form which had focus, which is the very subform
I am trying to get focus away from.
Does anyone have any ideas?
Thanks,
Bob
I have a subform on a form which is invisible most of the
time. When it is needed, it becomes visible. The user
edits a field or two and clicks a "DONE" button. At that
point I want the subform to become invisible again. The
problem is, as the user pushes the DONE button the subform
has focus, and I get an error trying to make the subform
invisible while it has focus. So I tried to use VBA to
move focus to a control on the parent form, but I keep
getting runtime errors saying "Access can't move the focus
to xxx". I'm guessing that SetFocus only works for
controls on the form (in this case subform) that currently
has focus. I also tried moving focus to the parent as a
whole,
Me.Parent.SetFocus
but, according to the documentation and I guess this is
what I see, that just gives focus to the last control on
the parent form which had focus, which is the very subform
I am trying to get focus away from.
Does anyone have any ideas?
Thanks,
Bob