Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date field formatting 1

Status
Not open for further replies.

ray00

Programmer
Jan 24, 2002
16
US
How can I set the text box in a form to show the current date and time in yyyymmdd format? I tried to do it with the input mask but no luck! Any help would be appreciated!

Thanks
 
Try using this code

txtBox.Value = Format(txtBox.Value, "yyyymmdd") No two nulls are the same
 
Hi,

Try using something like this - - youwill have to accomodate leading zeroes if you need them
Code:
TextBox1.Value = Year(Date) & Month(Date) & Day(Date)
Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Thanks Skip! Appreciate your prompt reply. It worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top