Take info from Ask Field and insert in 3 places on form?

J

JaneinPA

I'm not a programmer, I'm a teacher, but I'd like to do the following:

When I open my lesson plan template, I want Word to open an ASK dialog box
to ask me the date for my lesson plans. Ater I enter the date, I want the
form to automatically insert this information in three places on this same
document.

There must be a way to do this. Can anyone help? Thank you.
 
J

Jonathan West

JaneinPA said:
I'm not a programmer, I'm a teacher, but I'd like to do the following:

When I open my lesson plan template, I want Word to open an ASK dialog box
to ask me the date for my lesson plans. Ater I enter the date, I want the
form to automatically insert this information in three places on this same
document.

There must be a way to do this. Can anyone help? Thank you.

Mark the Ask field with a bookmark (Insert, Bookmark)

In the three other places, insert a Cross-Reference that points to the
bookmark.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
G

Greg Maxey

Jane,

Unfortunately ASK field don't update automatically when you open a new
document. You can do what you want with ASK and REF fields but you will
have to fire the prompt manually or with a macro. There is a way to do this
with a set of nested fields that avoids the macro.

1. In the template, create field in the format:

{QUOTE{IF{BkMrk}=""{SET BkMrk{Fillin "Put your prompt here"}}""}{BkMrk}},

where 'BkMrk' is an arbitrary bookmark name.



2. Then, at the start of the field, create an empty bookmark corresponding

to whatever you call 'BkMrk'. You can do this via Insert|Bookmark (with

nothing selected).



3. Enter the REF fields where you want the repeated date to appear. Lets
say you BkMrk name is LPDate. So position cursor where you want the second
date to appear, type LPDATE, select it and press CTRL+F9. Repeat for th
other two locations. Toggle the field coded ALT+F9



3. Save the template. Don't update the fields before saving the template,

otherwise you'll have to delete the bookmark and re-create it.



Now, since the bookmark is empty when a new document is created it will fire
asking for the prompt. Since it is not (or shouldn't) be empty at print
users will only be prompted to respond to the Fillin field if they

haven't already done so
 
J

Jonathan West

JaneinPA said:
You lost me at the cross reference thing. Sorry.

Having inserted the bookmark, move the cursor to the another place where you
want the same information to appear. Go to Insert, Cross-Reference, in the
dialog that appears, set the Reference Type to Bookmark, and select the
bookmark that you want to reference.

Repeat as many times as necessary


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
J

JaneinPA

That worked great! However, when I open a new copy of the template, it does
not prompt me for the ask field. How do I get the template to ask me for the
date as soon as I open the document? The cross-reference worked fine. Thank
you.
 
J

JaneinPA

Greg,

I have been trying to following your advice without much luck. I'm sorry I
am not up on programming, but I'm trying to learn.

I assume I type the coding just as you wrote it, and use the prompt "Week
Of" Is this correct? I tried this, saved the template and then opened a
new copy of the template. Nothing happens. Even though I typed
{QUOTE{IF{BkMrk}=""{SET BkMrk{Fillin "Put your prompt here"}}""}{BkMrk} as
you advised,


the field now appears as {IFBkMrk}={SETBkMrk{FILLINWeek Of}}}{BkMrk}

Sorry to be a pain, but I really don't understand what I'm doing. Jane
 
G

Greg

Jane, what you typed and what I advised aren't exactly equal ;-).
Duplicating field codes is difficult. Remember "each pair" of field
delimiters is entered with CTRL+F9. Don't use the "{ or }" keys to
enter any of the "{ or }" characters.

Note in what you typed the last REF FIELD is outside the greater Quote
field. It needs to be inside as shown below.

{QUOTE{IF{BkMrk}=""{SET BkMrk{Fillin "Put your prompt
here"}}""}{BkMrk}}
 
J

JaneinPA

Sorry, Greg. I guess I need elementary, step-by-step instructions. Maybe
this isn't the forum for it. Are you saying I type QUOTE then highlight and
hit CTRL+F9 Then I type IF, and do the same. Then type the name of my
bookmark (week) and do the same, etc. I've tried this but I have trouble
getting the brackets in the right places. I probably should just give up on
this project. Jane
 
J

Jonathan West

You have the wrong order. Press Ctrl-F9 and then type QUOTE between the
braces. Then with the cursor at the end of the word QUOTE, press Ctrl-F9
again to insert a further pair of braces. Between them, type IF, and so on.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
J

JaneinPA

Thanks. I think I nearly have it. When I open a new copy of the form, the
ask field comes on. I enter my info, but when I hit enter it doesn't
populate my form. Can I send you a copy of the file so you can see what I'm
doing wrong? Jane
 

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