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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date and a Time

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I am Having problem getting this code to work

Private Sub txtText3_Change()
txtText3.Text = Format(Now, "mm/dd/yyyy hh:mm ampm")
End Sub

when i run the program the time is not displayed any ideas?????
 
By putting that in the Change event, you're saying you only want this value to be assigned if you type something into the text box. The Change event runs when the contents of the text box are changed by the user.

Try put this in the text box's Default Value property in the properties pane:
Format(Now, "mm/dd/yyyy hh:mm ampm")
That should work. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top