Invoke Date Picker on Text Box using VBA

I am working with a form in Access 2010. I have a text box which has a date field for its source. I would like to set up a command button so that when the command button is clicked, it will cause the date picker for that text box to pop up. In other words, I would like to code the sub that handles the command button's click event so that focus is set to the text box and the date picker is evoked. Is there a way to do this in VBA?
Thanks,
Todd
LVL 7
shambaladAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
I don't think ... that's going to happen..

The date picker scenario only seems to work when you click into the text box, which triggers the picker if the data type is date/time.  Setting the focus to the text box does not seem to trigger it.  Even clicking in the text box one it has the focus does not seem to trigger it.

mx

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
conagramanCommented:
if the field in the table is date/time each time the textbox has the focus a little calendar icon will appear and when pressed will make a calendar appear
0
conagramanCommented:
here is a quick example
Database11.accdb
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
I think the OP knows this ... wants it to happen with a button.

mx
0
conagramanCommented:
didnt notice he was a master - my bad
still though he might not
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
well ... maybe not ...
0
shambaladAuthor Commented:
I guess I could use the date picker I used way back before MS decided to tease us with this built-in picker.
Thanks,
TOdd
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Unfortunately, as usual with many new features..... not fully implemented.   The Date Picker is VERY weak .
0
Jeffrey CoachmanMIS LiasonCommented:
Then perhaps using one of the many third party Date Picker/calendar controls is an option?

http://www.granite.ab.ca/access/calendars.htm
http://www.accessmvp.com/JConrad/accessjunkie/calendars.html

JeffCoachman
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.