Time Picker Question (1 Viewer)

rxm01l

Registered User.
Local time
Today, 11:46
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:

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
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:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 18:46
Joined
Jul 9, 2003
Messages
16,244
Found it! .......... ............. Just in Time!
 

Attachments

  • Robinson_Timeclock.zip
    41.6 KB · Views: 152
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
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?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 18:46
Joined
Jul 9, 2003
Messages
16,244
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?

I have a vague recollection of seeing one in the distant past. I also have the impression that I didn't like it, there was something amiss with it. Can't recall the details.

With regard to developing your own time-picker, one approach I use is to search VB6 forums, I occasionally find stuff which I can utilise in MS Access.

I did a quick search of VB6 stuff and found this:-

https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=74929&lngWId=1

And This:-
https://www.codeproject.com/Tips/623035/Complete-Date-Time-Picker-Control

There might be some usable code you can extract from the example.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 18:46
Joined
Jul 9, 2003
Messages
16,244
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.
Exactly! It's the best way to learn... I have a set of Video's that demonstrate the construction of a Search Form.

The idea of the Search Form Video set is to encourage people to build there own Search Form and in the process, learn VBA...

Creating the Search Form was one of my first projects and taught me loads about programming...

Sent from my Pixel 3a using Tapatalk
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:46
Joined
Oct 29, 2018
Messages
21,358
… or does anyone know of an existing example?
There are a few samples at UA like this one:


 

Users who are viewing this thread

Top Bottom