Manual Adjustment of Time

ddrew

seasoned user
Local time
Today, 10:36
Joined
Jan 26, 2003
Messages
911
On my form I have a textbox configured as a Date/Time function. The time is grabbed automatically at the click of a button. Sometimes the user has to backdate the time, if the user clicks in the box he also has access to the date which also shows in there, is there a way that I can hide the date part and just give them ability to change the time?
 
Its all to do with the way your format the text box.

This seems to do the trick. I have created a form with 3 TextBoxes and 2 Command Buttons. If you change the Time in Text1 it then then incorporates the new time into the Date and Time in Text2.

Just play with this and you will hopefully find your solution.

Private Sub Command1_Click()

Text1.SetFocus
Text1.Value = Format(Text0.Value, "hh:mm:ss")


End Sub

Private Sub Command2_Click()

Text2.SetFocus
Text2.Value = Format(Text0.Value, "dd/mm/yyyy") & Format(Text1.Value, " hh:mm:ss")
Command1.SetFocus

End Sub

Private Sub Form_Load()

Text0.SetFocus
Text0.Value = Now

End Sub
 
Last edited:
Ted, had a go with this but as soon as I click in text1 to change the time I get access to the date as well, any ideas? Any chance of posting your example to see where I'm going wrong?
 
Ok - Form 1 is what you need. Just play with it to get your desired input and output.
 

Attachments

Users who are viewing this thread

Back
Top Bottom