I have a user form with text boxes within a frame and a button outside the
frame. In the _AfterUpdate() handler for the text boxes, I want to set
focus to the button. When I try this, is get a "unexpected call to method
or property access" error.
If I move the button into the frame SetFocus works.
If I try to set the caption of the button when it is outside the frame, it
works.
Can anyone explain what's happening here? and how to do the set focus?
Also, I only want the frame to group the edits; I don't want it to have any
functional impact. Is there another way to achieve this?
If it makes any difference, this is in the visual basic editor in Word.
I thank you for your help.
Jim Cant
Perry - 21 Mar 2005 01:28 GMT
The easiest way without VBA code, is to check the taborder of both the frame
and commandbutton.
Obviously, the commandbutton has to tabindexed after the frame.
So check yr frame's tabindex, and then set the commandbutton's tabindex
(frame tabindex + 1)
Last thing you have to check wether the last textbox in yr frame indeed has
the highest tabindex of
all textboxes/controls.
This will likely solve the issue.
Repost if doesn't; and if so, something else must be bugging you; chances
are that you'll need
some coding to correct things afterall.
Krgrds,
Perry
> I have a user form with text boxes within a frame and a button outside the
> frame. In the _AfterUpdate() handler for the text boxes, I want to set
[quoted text clipped - 15 lines]
>
> Jim Cant