|
-
Oct 1st, 2005, 12:09 PM
#4
Frenzied Member
Re: [RESOLVED] Date format question
koolzap351:
The following code will put the current date into a text box when you click on the text box:
Private Sub txtDate_Click()
If txtDate.Text <> CStr(Date) Then
txtDate.Text = Date
End If
End Sub
If you want to have the date appear in the text box when the form loads, then put this code in the form_load event instead of the txtDate_Click event.
This code will put the current time into a text box when you click on the text box:
Private Sub txtTime_Click()
If txtTime.Text <> CStr(Time) Then
txtTime.Text = Time
End If
End Sub
Again, if you want the time to appear in the text box when the form is loaded this code need to be in the form_load event.
This should work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|