change date format??

  • Thread starter Thread starter ahyui
  • Start date Start date
A

ahyui

How can I change the date format from original 12/1/2004 to 12-1-2004 (from
VBA program code).
i.e. TextBox1.value = date
It shows 1/1/2004
I want it shows as 1-1-2004
How can I do it?
thank you.
 
Dear ahyui

TextBox1.value = format(date,"dd-mm-yyyy")
or
TextBox1.value = format(date,"d-m-yyyy")

Best regards

Wolf
 
Textbox1.Value=Format(Date,"d-m-yyyy")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thank you very much

Bob Phillips said:
Textbox1.Value=Format(Date,"d-m-yyyy")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top