Information générale
Catégorie:
Codage, syntaxe et commandes
I am a beginner at Visual Basic. I've having problem with a text box formatting a date how I want it to. I want the date in the format mm/dd/yyyy. I go into the properties of the textbox and set the DataFormat field to that date format. The following code example will not use the format of the text box.
myDate = #4/5/2001#
Text1.Text = myDate
The above code displays the date in the textbox as m/d/yy instead of the 4 digit year i want to show.
The following is working for now but i think there should be a better way.
myDate = #4/5/2001#
Text1.Text = Format(myDate,"mm/dd/yyyy")
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement