Greg
Thu Aug 03 15:07:22 CDT 2006
Nancy,
I suppose you would only want to update if the data in the dropdown
changes. This might work. Lets say you have dropdown1 and text1
(formatted as date) and the dropdown is the status of something:
Option Explicit
Private oDoc As Document
'Set intial status as " " when creating a new form and store the status
in a doc variable.
Sub AutoNew()
Set oDoc = ActiveDocument
oDoc.FormFields("DropDown1").Result = " "
oDoc.Variables("Status").Value = " "
End Sub
'Compare the stored value with the value selected. Update date if
applicable.
Sub OnExitDD1()
Set oDoc = ActiveDocument
If oDoc.FormFields("DropDown1").Result <>
oDoc.Variables("Status").Value Then
oDoc.FormFields("Text1").Result = Date
oDoc.Variables("Status").Value = Doc.FormFields("DropDown1").Result
End If
End Sub
Nancy wrote:
> Hi Cindy,
>
> I'm hoping the following information is helpful...
>
> I have created a protected user form. I have one drop-down that has a list
> of items, and beside it a text field (date) that the user would insert the
> date to show the date that the list item was updated. I was hoping that when
> the user selects a new item from the drop-down, the text field would
> automatically update to today's date.
>
>
>
> "Cindy M -WordMVP-" wrote:
>
> > Hi =?Utf-8?B?TmFuY3k=?=,
> >
> > > I am using Word 2003 and have created a form for users to complete. I would
> > > like to have a field that automatically inserts today's date when a user
> > > changes their selection in a drop-down field.
> > >
> > > For example, if a user selects a particular status from the status
> > > drop-down, the corresponding status date field is automatically updated to
> > > today's date.
> > >
> > > A user may not necessarily select a new status each time they open the
> > > document, so it has to be specific to the corresponding drop-down.
> > >
> > Since you don't specify what kinds of fields or dropdowns and whether these are
> > in a UserForm or a document, it's difficult to give you any specific kind of
> > help...
> >
> > To get today's date, using VBA: Date()
> >
> > Cindy Meister
> > INTER-Solutions, Switzerland
> >
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> >
http://www.word.mvps.org
> >
> > This reply is posted in the Newsgroup; please post any follow question or reply
> > in the newsgroup and not by e-mail :-)
> >
> >