Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Set a text box the current date/time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NikV - 03 Jan 2006 18:49 GMT
I have a command button.  After the user clicks on it I want to populate a
text box with a "CR" and the current date/time formated as mmyyhhmm.  For
example, the resulting string would be CR01054505.  Please help.  Thanks!
Greg Collins [InfoPath MVP] - 09 Jan 2006 17:50 GMT
Although it is likely possible to do this with rules, it will be complicated. Best bet is to use code.

Signature

Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com

I have a command button.  After the user clicks on it I want to populate a
text box with a "CR" and the current date/time formated as mmyyhhmm.  For
example, the resulting string would be CR01054505.  Please help.  Thanks!
S.Y.M. Wong-A-Ton - 28 Jan 2006 17:25 GMT
The now() function returns the current system date and time in a format like
yyyy-mm-ddThh:mm:ss. So you can use this information to create a rule on the
button that sets the value of the text box using a formula like:

concat("CR", substring(now(), 6, 2), substring(now(), 3, 2),
substring(now(), 12, 2), substring(now(), 15, 2))

---
S.Y.M. Wong-A-Ton

> I have a command button.  After the user clicks on it I want to populate a
> text box with a "CR" and the current date/time formated as mmyyhhmm.  For
> example, the resulting string would be CR01054505.  Please help.  Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.