Jump from a checkbox to a text field in a form

R

ronben

Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel My form has a question to answer with either a Yes or a No labelled checkbox. If the user clicks Yes, the next section has a series of questions based on the Yes response. If the user clicks the No checkbox, I would want that section of nonrelevant questions bypassed by a jump to a field in a different section of the form. The jump should be initiated by the value in the No checkbox ("Run macro on exit"). There should be a way to do this using VBA (I have Word 2004) but the Word Help does not flesh out how to do this using VBA. Comments would be appreciated.
 
J

John McGhie

If you want to "jump" to the field, use the GoTo method of the Selection
object to go to a bookmark:

Selection.GoTo What:=wdGoToBookmark, Name:="MyBookmark"

Alternatively, you could bookmark what you DON'T want them to see, select
the bookmark, and set its font property to Hidden.

Cheers


Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel My form
has a question to answer with either a Yes or a No labelled checkbox. If the
user clicks Yes, the next section has a series of questions based on the Yes
response. If the user clicks the No checkbox, I would want that section of
nonrelevant questions bypassed by a jump to a field in a different section of
the form. The jump should be initiated by the value in the No checkbox ("Run
macro on exit"). There should be a way to do this using VBA (I have Word
2004) but the Word Help does not flesh out how to do this using VBA. Comments
would be appreciated.

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:[email protected]
 
R

ronben

If you want to "jump" to the field, use the GoTo method of the Selection
> object to go to a bookmark:
>
> Selection.GoTo What:=wdGoToBookmark, Name:="MyBookmark"
>
> Alternatively, you could bookmark what you DON'T want them to see, select
> the bookmark, and set its font property to Hidden.
>
> Cheers
>
>
> On 19/12/09 9:25 PM, in article (e-mail address removed)2ac0,
> "[email protected]" wrote:
>
>
> --
>
> The email below is my business email -- Please do not email me about forum
> matters unless I ask you to; or unless you intend to pay!
>
> John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
> McGhie Information Engineering Pty Ltd
> Sydney, Australia. | Ph: +61 (0)4 1209 1410
> +61 4 1209 1410, mailto:[email protected]
>
>
> Not having much success. If NO is checked, I want to go to the next following section. If YES is checked I want to skip the next following section. I attempted to test if the checkbox was checked or not with an If-Then statement, such as:

If Check1 = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
End If

If Check1 is checked, I do not want to skip the next section.

If Check2 is checked, I want to bypass the next section and land on a bookmark in that section.
This code is bypassing the next section whether or not it is checked off. I am attempting to use whatever logic I remember from my VB for Windows days about a dozen years ago. However the True condition does not seem to work.

Thanks.
 
J

John McGhie

Not having much success. If NO is checked, I want to go to the next
If Check1 = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
End If

If Check1 is checked, I do not want to skip the next section.

If Check2 is checked, I want to bypass the next section and land on a bookmark
in that section.
This code is bypassing the next section whether or not it is checked off. I
am attempting to use whatever logic I remember from my VB for Windows days
about a dozen years ago. However the True condition does not seem to work.

You've left out the "Value" property, so your test will always be "True".
You are effectively saying "If Check1 is not 0 then" and Check1 is not zero,
it's an object.

You also need to intercept the OnChange event. Have a look in the Word 2004
VBA help for the topic "CheckBox Control, Enabled, Locked Properties
Example"

See the topic "CheckBox Control, Enabled, Locked Properties Example" in the
Word help.

See "Please Fill Out This Form" here:
http://www.ComputorCompanion.com/LPMArticle.asp?ID=22

There are five parts:
http://www.ComputorCompanion.com/LPMArticle.asp?ID=46
http://www.ComputorCompanion.com/LPMArticle.asp?ID=119
http://www.ComputorCompanion.com/LPMArticle.asp?ID=127
http://www.ComputorCompanion.com/LPMArticle.asp?ID=136


Cheers

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:[email protected]
 

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