PPT 2007 VBA Form: How to get all textbox controls into Insert mod

D

Dave Jenkins

I think this has been thoroughly discussed previously elsewhere, but I don't
seem to be able to find the applicable references this morning.

I have a form with multiple text boxes. In the intialization of the form I
say

sendkeys {INSERT}

The keyboard always appears to be in Insert mode for the first field
(regardless of its setting prior to bringing up the form), but the second box
is always in Overstrike (regardless of the keyboard setting prior to bringing
up the form). Now get this: If I start by putting the cursor in the second
field and put it in Insert mode (using the KB key) then when I switch to the
first field it willl also be in Insert mode. BUT: If I start with second
field, put it in Overstrike mode, and then move to the first field, it will
be in Insert mode.

Why? How can I make sure that all fields on the form will be in Insert
mode? Is there a textbox initialization event that I should be issuing the
sendkeys from, too?

Thanks!
 
S

Shyam Pillai

Set the EnterFieldBehavior property for all the textboxes to
fmEnterFieldBehaviorRecallSelection instead of
fmEnterFieldBehaviorRecallSelectAll.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
D

Dave Jenkins

That doesn't seem to work, Shyam -- it seemed to make no difference at all.
Furthermore, making those changes caused the initial cursor location now to
be in the second field instead of the first - why would that be? (I really
want the cursor to be in the first field when the form opens up.)

Any other suggestions?
--
Dave Jenkins
K5KX


Shyam Pillai said:
Set the EnterFieldBehavior property for all the textboxes to
fmEnterFieldBehaviorRecallSelection instead of
fmEnterFieldBehaviorRecallSelectAll.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
D

Dave Jenkins

To get the initial entry point to be in the first field, I changed the tab
index for that field to 0. Behavior now is also interesting: The initial
entry point is in the first field, but now the first field is in Overstrike
mode, and the second field is in Insert mode!

So obviously there's some interaction with tab order, Insert/Overstrike
mode, and EnterFieldBehavior property effects - but what, exactly is it?
--
Dave Jenkins
K5KX


Shyam Pillai said:
Set the EnterFieldBehavior property for all the textboxes to
fmEnterFieldBehaviorRecallSelection instead of
fmEnterFieldBehaviorRecallSelectAll.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
S

Shyam Pillai

Dave,
I am not sure which part you are missing.

1. Create a userform.
2. Add 3 text box controls on it with some default text.
3. Select all 3 text boxes
4. Set the EnterFieldBehavior property to EnterFieldBehaviorRecallSelection
(1) for all the text boxes.
5. Run the form.

Tab thru the text boxes, they will always be in insert mode.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com



Dave Jenkins said:
To get the initial entry point to be in the first field, I changed the tab
index for that field to 0. Behavior now is also interesting: The initial
entry point is in the first field, but now the first field is in
Overstrike
mode, and the second field is in Insert mode!

So obviously there's some interaction with tab order, Insert/Overstrike
mode, and EnterFieldBehavior property effects - but what, exactly is it?
 
D

Dave Jenkins

I had done all those steps (but on my current form, not a new one) -- and it
still misbehaved. I removed the "sendkeys "{INSERT}" " from the
userform_initialization, and now the insert/overstrike mode is correct for
all the fields. Go figure.

Thanks, Shyam.
 
S

Steve Rindsberg

Dave Jenkins said:
That doesn't seem to work, Shyam -- it seemed to make no difference at all.
Furthermore, making those changes caused the initial cursor location now to
be in the second field instead of the first - why would that be? (I really
want the cursor to be in the first field when the form opens up.)

In the Initialize event:

Me.txtNameOfFirstField.SetFocus

?
 
D

Dave Jenkins

As I said below, Steve, it seems to have moved back to the first field when I
removed the sendkeys statement -- which doesn't make much sense. I might
have a setFocus in there someplace already - I remember seeing that someplace
in the dim, dark, past. (Last week, maybe.)

Thanks for the tip.
 

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