today's date in a form

G

Guest

Is there a way to create a dropdown, or something, in a user form that allows
the user to click on a prompt like "Date Shipped", and have that shipping
day's date populate the cell?

I tried using a Text Form Field, set to "Current Date", so as uses ship
items, they won't have to type in the date each time they ship something.

But if I place "Current Date" Text Form Fields in the Date Shipped cell for
each row of the table, they seem to all display the date that I placed them
there, not the date(s) in the future when users will use my form to log daily
shipments. Where am I going wrong?
 
G

Graham Mayor

If http://www.gmayor.com/popup_calendar.htm doesn't appeal, you could add a
check box form field and run the following macro on exit from the check box

Sub ShippingDate()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
If oFld("Check1").Result = True Then
oFld("Text1").Result = Format(Date, "dd mmmm yyyy")
Else
oFld("Text1").Result = "Awaiting Shipment"
End If
End Sub

which will put the current date in the field Text1 when the user tabs out of
the check box field with the box checked, or "Awaiting Shipment" is the
check box is unchecked.
http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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