text field automation

P

Pie in the Sky

Is it possible to automatically tie in a text field when the Date field is
chosen? For example, if I choose Monday, the appropriate description in a
text field automatically fills in. (There are 5 descriptions from Monday
through Friday.)
 
D

Doug Robbins

Not sure what sort of "text fields" you are talking about. However, I you
are talking about a protected document with formfields, and you had the days
of the week in a DropDown type formfield, and you had an autotext entry for
each day of the week, the following code would insert the appropriate
autotext entry into a formfield based on the day of the week selected from
the DropDown formfield.

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name
'
Dim myDrop as Formfield, Address as String

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown
Company = myDrop.ListEntries(myDrop.Value).Name
Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value
ActiveDocument.FormFields("Text1").Result = Address


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
P

Pie in the Sky

I am getting the compile error on the myDrop.value.
I am using MS Word 2002.
 

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