Tuesday, December 11, 2007

Example of the Format Function

Example of the Format Function

Example of the Format Function

Step 1:

Add a Command button to the form:

Step 2:

Below are the programming codes displaying words in General Date, Long Date&ldots; formats:

Private Sub Command1_Click()

Form1.Print Format(Now, "General Date")

Form1.Print Format(Now, "Long Date")

Form1.Print Format(Now, "Medium Date")

Form1.Print Format(Now, "Short Date")

Form1.Print Format(Now, "Long Time")

Form1.Print Format(Now, "Medium Time")

Form1.Print Format(Now, "Short Time")

End Sub

Step 3:

This is the result of displaying Date and Time in various formats defined previously:


No comments: