Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 01-30-2018, 04:53 AM   #1
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,271
Thanks: 115
Thanked 3,081 Times in 2,799 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
A better date picker

Some months ago I uploaded a replacement date picker (see DatePicker.accdb attached) that has no Active X controls and can also be used in 64-bit Access.

It was originally posted in response to a question about Stephen Lebans' calendar in this thread

https://www.access-programmers.co.uk...10#post1533910

Having just spent a long time searching for the thread, I'm posting it here so its easier to find in the future!

The original version by Brendan Kidwell is open source from 2003 and can be found here:
http://www.glump.net/content/accessdatepicker/

However, I've made extensive changes to the appearance of the calendar form



If all you want is a visual calendar, it will certainly do that
However, its main purpose is to input a date in a form textbox
All you need for that is one line of code in the textbox click event:

Code:
Private Sub txtDate_Click()
    InputDateField txtDate, "Select a date to use this on your form"
End Sub
The string "Select a date to use this on your form" is used for info on the form and can be adapted to suit

To use, copy frmDatePicker & modDatePicker to your own database
Ignore frmMain - its only needed for the example db
Attached Images
File Type: png DatePicker.PNG (24.2 KB, 5189 views)
Attached Files
File Type: zip DatePicker.zip (90.9 KB, 1406 views)

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)

Last edited by isladogs; 02-01-2018 at 01:23 AM.
isladogs is offline  
The Following 6 Users Say Thank You to isladogs For This Useful Post:
ahmedjamalaboelez (04-03-2019), bdra2778 (02-21-2019), Frothingslosh (01-31-2018), JoeNoEskimo (03-29-2019), Scribtor (10-11-2018), usm01 (02-23-2019)
Old 10-11-2018, 09:16 AM   #2
Scribtor
Newly Registered User
 
Join Date: Sep 2018
Posts: 16
Thanks: 8
Thanked 0 Times in 0 Posts
Scribtor is on a distinguished road
Cool Re: A better date picker

Million thanks! Should be a sticky so as to be easier to reach
Scribtor is offline  
Old 10-11-2018, 09:44 AM   #3
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,271
Thanks: 115
Thanked 3,081 Times in 2,799 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: A better date picker

Glad you like it. If there are too many stickies, none of them stand out.

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline  
Old 11-04-2018, 01:58 AM   #4
soap
Newly Registered User
 
Join Date: Nov 2018
Posts: 25
Thanks: 4
Thanked 0 Times in 0 Posts
soap is on a distinguished road
Re: A better date picker

Thank you very helpful
soap is offline  
Old 02-14-2019, 06:59 PM   #5
bdra2778
Newly Registered User
 
Join Date: Feb 2019
Location: Nicaragua
Posts: 34
Thanks: 6
Thanked 7 Times in 7 Posts
bdra2778 is on a distinguished road
Re: A better date picker

This is a great example, thanks
bdra2778 is offline  
Old 03-29-2019, 06:34 AM   #6
JoeNoEskimo
Newly Registered User
 
Join Date: Mar 2019
Posts: 2
Thanks: 2
Thanked 1 Time in 1 Post
JoeNoEskimo is on a distinguished road
Smile Re: A better date picker

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
JoeNoEskimo is offline  
The Following User Says Thank You to JoeNoEskimo For This Useful Post:
isladogs (03-31-2019)
Old 08-06-2019, 08:16 AM   #7
rxm01l
Newly Registered User
 
Join Date: Mar 2013
Posts: 32
Thanks: 9
Thanked 0 Times in 0 Posts
rxm01l is on a distinguished road
Re: A better date picker

I would like to utilize this Calendar on my form contained. Start_Date and End_Date.. How would I code this so that your Calendar popup so that I can select Start_Date from Calendar and End_Date from this Calendar? Please advise.. Thank You..

rxm01l is offline  
Old 08-06-2019, 03:29 PM   #8
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,271
Thanks: 115
Thanked 3,081 Times in 2,799 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: A better date picker

Hi rxm
Just follow the instuctions in post #1, adding the InputDateField code to the click event of both date controls
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline  
Old 08-07-2019, 04:26 AM   #9
rxm01l
Newly Registered User
 
Join Date: Mar 2013
Posts: 32
Thanks: 9
Thanked 0 Times in 0 Posts
rxm01l is on a distinguished road
Re: A better date picker

Thank You Isladogs, I got it to work right after I posted my question. Great learning tool..

If I want add a Fix Time after selecting Date. Example: 08/07/2019 07:00:00 AM or 08/07/2019 03:00:00 PM, how would I do that by using this Calendar? in my old Calendar I used:
Me.Start_DATE.Value = Me.Calendar.Value +TimeValue ("03:00:00 AM").. doesn't see to work on this calendar... Any recommendation would be appreciated.. Thank You so much..
rxm01l is offline  
Old 08-08-2019, 12:28 PM   #10
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,271
Thanks: 115
Thanked 3,081 Times in 2,799 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: A better date picker

Hi rxm
Posting a question often leads almost immediately to the solution
Regarding times, have you looked at the code suggested by JoeNoEskimo in post #6?

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline  
Closed Thread

Tags
date picker; 64-bit

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Date Picker Use AND User Date Entry JessicaGomo Forms 2 03-27-2015 06:45 AM
Hiding the date picker from date fields penfold1992 Queries 2 11-05-2013 08:32 AM
Date Field in a Search Form with a date picker option oblivion86 Forms 3 08-28-2012 05:53 AM
2007 Date Picker on a from how to set default date to +5 daysú Singlespeed Forms 1 03-02-2011 07:51 AM
Textbox calendar - date picker - event to close after date made Rx_ Modules & VBA 1 10-28-2010 11:59 AM




All times are GMT -8. The time now is 07:34 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World