shift-tab command does not work in protected form

R

Roxy

Hi there quick question:
My shift-tab command does not work in all the password protected forms that
I created in MS2003. Users are not happy. Any suggestions?
Also is there any way to highlight/copy several form fields at once say like
Name
Mailing Address
City State Zip
so users don't have to re-type the same info over and over agin into form
fields?
Cheers!
~Roxy
 
D

Doug Robbins - Word MVP

Shift+Tab works for me - goes back to the previous field. Is that what your
users want it to do?

See the Repeating Data item on fellow MVP Greg Maxey's website at:

http://gregmaxey.mvps

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Roxy

Yes this is what I would like to happen.

"Shift+Tab works for me - goes back to the previous field."

Does it matter that the forms are password protected? And I have VB code in
the forms for tabbing navigation?
~Roxy
 
D

Doug Robbins - Word MVP

The form would need to be protected, but the password would not make any
difference. More likely you VB code is interfering with the default
behaviour of the Shift+Tab key combination.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Roxy

This is the code I am using for directionality for the tabbing control:
Sub Goto_Provider()
Selection.GoTo What:=wdGoToBookmark, Name:="Provider"
End Sub

Sub Goto_Facility()
Selection.GoTo What:=wdGoToBookmark, Name:="Facility"
End Sub

Sub Goto_Addy()
Selection.GoTo What:=wdGoToBookmark, Name:="Addy"
End Sub

And so on. So the form tabs left to right, etc. Any ideas on how to fix
these so you could "shift-tab" back one form field?
Thanks again for all your help!!
~Roxy
 
D

Doug Robbins - Word MVP

I assume that you are using these macros on exit from/entry to particular
formfields. I don't think that there is any way to limit their operation.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Roxy

Yep, they are on exit commands. So luck for me then?
What about the ablitily to highlight multiple form fields at one time to
copy and paste? Is that an option in protected forms?
 
D

Doug Robbins - Word MVP

You are out of luck again. It is however possible to use vba to unprotect
the document, and copy formfields identified in the code and paste them
elsewhere in the document.

For example:

Sub addrow()
'
' Macro created 02/02/03 by Doug Robbins
' To add a new row to a table containing formfields in every column
' automatically on exit from the last cell in the present last row of the
table
Dim rownum As Integer, i As Integer
ActiveDocument.Unprotect
ActiveDocument.Tables(1).Rows.Add
rownum = ActiveDocument.Tables(1).Rows.Count
For i = 1 To ActiveDocument.Tables(1).Columns.Count
ActiveDocument.FormFields.Add
Range:=ActiveDocument.Tables(1).Cell(rownum, i).Range, _
Type:=wdFieldFormTextInput
Next i
ActiveDocument.Tables(1).Cell(ActiveDocument.Tables(1).Rows.Count, _
ActiveDocument.Tables(1).Columns.Count).Range.FormFields(1).ExitMacro =
"addrow"
ActiveDocument.Tables(1).Cell(ActiveDocument.Tables(1).Rows.Count,
1).Range.FormFields(1).Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Roxy

Dang! Oh well the users will just have to get over it. Thank you so much
for your time and all your help :)

~Roxy in Alaska
 
G

Gordon Bentley-Mix

Roxy,

I think I understand how your form works, but please correct me if I'm wrong.

The form has several formfields on it. Each formfield has an OnExit macro
associated with it (or at least most do). These macros are intended to
control navigation through the form. For example, when the user exits a
particular field (call it FF1) focus is automatically set to the next field
to be completed (call it FF2). Exiting FF2 sets focus to the next (FF3). And
so on through the form.

I guess what has me confused is why the macros are necessary? Is it that the
"order" of the fields on the form is not the order in which they should be
logically completed? For example, after completing FF1 the user should then
complete FF3 and then FF2? Otherwise, it seems to me that the standard Word
functionality of simply tabbing through the fields would suffice, and it
would also resolve the problem with using Shift+Tab. A macro to set focus to
the next field on the form seems like overkill.

If this is indeed how your form works, then it's perfectly understandable as
to why Shift+Tab doesn't work. As far as Word is concerned, an Exit event is
an Exit event. It doesn't matter if you press Tab or Shift+Tab or even mouse
click on another field; Word is going to run the OnExit macro and do whatever
the macro says to do - in this case, set focus to a particular field. (And if
I was one of the users, this would annoy the crap out of me - especially if
the form had like 50 fields on it and I had to go through them all just to
get back to the last one I completed.)

BTW, if this was my project, I'd probably take a different approach. Rather
than using formfields with OnExit macros to guide navigation, I'd put a
UserForm over the top and have the users enter the info through the UserForm.
This has several advantages in that: you can structure the UserForm any way
you like so info that belongs together can be collected together; you can
control validation and make fields mandatory, and; you can even save the
input and run the code again. You can also add content to your document and
thus (possibly, albeit using a different process) achieve your goal "to
highlight multiple form fields at one time to
copy and paste".
--
Cheers!
Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 

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