Display only the time in a date and time field

WhiskyLima

Registered User.
Local time
Today, 21:56
Joined
Oct 8, 2013
Messages
48
Hey guys, just a quick one I'm sure, I have a date and time field in my database, which is only storing the time (I know it has the 1/1/1900 as the date too) but when I select the field to change the entry it show both the date and the time despite the formatting rule in the properties window.

What I would like is to have just the time showing and for it to be unselected.

This first bit of code works fine when I have either clicked or tabbed to the field and does almost everything but then it selects all the text in the field

Code:
Dim removeDate As String
removeDate = Right(Me.txtDepartureTime, 8)
Me.txtDepartureTime = removeDate

then to remove the selection I use this line

Code:
Me.txtDepartureTime.SelStart = Len(Me.txtDepartureTime)

Which puts me right back to square one with the date showing too.

If there is another way of doing this I would be grateful to know. Many thanks!
 
Make the control unbound and use VBA to transfer from the recordset field to the control in the form Current Event and back in the control AfterUpdate Event, while translating between date and string.
 
Ok I will give that a go and see how it works out. Thanks
 

Users who are viewing this thread

Back
Top Bottom