Time Picker Question

rxm01l

Registered User.
Local time
Today, 15:21
Joined
Mar 5, 2013
Messages
32
Very nice tool. I have added it to my pet project. I did however make one little addition. At some places in the database I'm working on I want the date picker to return date and time. So I made this change:

' Use this method to prompt for and set a new date on a textbox
Public Sub InputDateField(x As TextBox, AddTime As Boolean, Optional Prompt As String = "Select Date")

mPrompt = Prompt
mInitDate = x.Value

RunDialog

If IsDate(mReturnValue) Then
If AddTime = True Then
x.Value = mReturnValue & " " & Time()
Else
x.Value = mReturnValue
End If
End If

End Sub

Call it:
InputDateField DonationDate, False, "Date Picker"
InputDateField DistributionDateTime, True, "Date Picker"

I hope this little addition helps someone else,
Joe



Hello, Joe.. Thanks for the Post was very helpful..
I'm using Isladogs Calendar on my database, however, now my users are asking if I can add time on to the Calendar after I selected any date from the Calendar.. Ex.. 08/19/2019 07:00:00 AM Or 08/19/2019 03:00:00 PM.. can you help?

Thank You..
 
Last edited by a moderator:
I moved this question from the Sample Databases area to make it easier for members to respond.
It relates to a contribution by JoeNoEskimo to this thread A Better Date Picker
 
Last edited by a moderator:
Garry's time picker uses a similar approach to my date picker and works well if you want times to the nearest five minutes.
If you need more accuracy, the times can be edited manually.

I've always liked the time selection scroll wheel approach as used on an iPhone.
Perhaps I'll do that in Access one day … or does anyone know of an existing example?
 
Mind you it might be a pointless exercise, I don't see much requirement for such a feature.

Nor me...but that's not stopped me in the past! Sometimes I like to create examples that interest me just as a coding challenge.
 
A recent example of mine that was in response to a question at another forum but probably of limited use was : Accurately Move Forms and Controls

I did it mainly as a challenge. The OP never explained why he wanted it and got very stroppy when asked.
I vowed never to assist him again :D
 
… or does anyone know of an existing example?
There are a few samples at UA like this one:


index.php
 

Users who are viewing this thread

Back
Top Bottom