-
I am stupid and I don't know how to make a variable say the date and time. Like say it is 1/1/00 7:14 pm thats what i want my variable to say. but i don't know how. I want it also to be the time as of right now. thanks
------------------
Sincerely,
Chris
:-) ;-)
Email [email protected]
-
Put a Command Button on a Form and place the following in it's click event:
[code]Private Sub Command1_Click()
Dim MyDate As String
Dim MyStr As String
Dim MyTime As String
MyDate = Date ' Assign Today's date to a String
MyStr = Format(MyDate, " dddd, mmmm d, yyyy")
' Returns "Todays date as day of the week and
' Month of the year
' e.g. Wednesday Feb 4, 1997
' this is a VB internal function - see VB Help
' under Display Date
MyTime = Time 'Assign the current time.
'Time instead of Time$
'formats the AM or PM
'automatically
Print MyStr, MyTime
End Sub
[//code]
-
Format(Now(), "general date")
------------------
Marty