R
ron
Hi folks
I'm rather new to using VBA in word, but have done some
previous work in Access. I'm the only one in my office
who has any idea about 'stuff behind the scenes', and as a
result, I've been asked to try to modernise a few of our
documents.
I'm working in Word 2000, running under either NT4 or XP.
I have created a document with a series of form fields
(both text & check boxes). The form is protected. I am
trying to write 'Onexit' macros for the form fields in
order to confirm that the user has completed the field,
and to validate any data that they have enterred. Each
field has a unique bookmark allocated in teh form field
properties screen.
Everything I've done seems to work ok except for the final
bit - if the user has either failed to complete the field,
or has completed it invalidly, I want to either :
1) Blank the field (if appropriate) and set the cursor
back to the start of that field, or,
2) If the field is one of a series of fields (either
text or check box), blank them all and set the cursor back
to the start of the the first box in the series (which may
or may not be the first box in the document)
If I was doing it in Acess, I would simply set the focus
to the particluar field using it's name, but that doesn't
seem to work in Word - the cursor just seems to go on to
the next field and I can't figure out how to fix this!
Grateful for any help that you can provide. Also, if
anyone could recommend a good book available in the UK,
I'd be most appreciative.
Thanks
Ron Snape
I'm rather new to using VBA in word, but have done some
previous work in Access. I'm the only one in my office
who has any idea about 'stuff behind the scenes', and as a
result, I've been asked to try to modernise a few of our
documents.
I'm working in Word 2000, running under either NT4 or XP.
I have created a document with a series of form fields
(both text & check boxes). The form is protected. I am
trying to write 'Onexit' macros for the form fields in
order to confirm that the user has completed the field,
and to validate any data that they have enterred. Each
field has a unique bookmark allocated in teh form field
properties screen.
Everything I've done seems to work ok except for the final
bit - if the user has either failed to complete the field,
or has completed it invalidly, I want to either :
1) Blank the field (if appropriate) and set the cursor
back to the start of that field, or,
2) If the field is one of a series of fields (either
text or check box), blank them all and set the cursor back
to the start of the the first box in the series (which may
or may not be the first box in the document)
If I was doing it in Acess, I would simply set the focus
to the particluar field using it's name, but that doesn't
seem to work in Word - the cursor just seems to go on to
the next field and I can't figure out how to fix this!
Grateful for any help that you can provide. Also, if
anyone could recommend a good book available in the UK,
I'd be most appreciative.
Thanks
Ron Snape