?
Solved

microsoft access 2010, event for change in text box date picker

Posted on 2014-04-29
10
Medium Priority
?
2,211 Views
Last Modified: 2014-05-06
I need to execute code at the exact point a date is selected in a text box using the date picker. After Update only seems to fire after the cursor exits the text box, not when a date is selected.
0
Comment
Question by:pabrann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1800 total points
ID: 40030427
Try the OnChange event instead of AfterUpdate  event

mx
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40030431
-
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1800 total points
ID: 40030449
And also ... refer to the .TEXT property of the text box - Example:

Private Sub txtYourDateBox_Change()

dim x
x = txtYourDateBox.Text


End Sub
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:pabrann
ID: 40030460
I thought that would work also but I tried the following and it does not change the text box named TD1 upon changing a date selected:

Private Sub txtStartDate_Change()
 
    Me.TD1 = txtStartDate


End Sub
0
 
LVL 75
ID: 40030466
Private Sub txtStartDate_Change()
 
    Me.TD1 = txtStartDate.Text


End Sub
0
 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 200 total points
ID: 40030541
@mx
I think the asker is close to winding up in the weeds.
The DatePicker is a fussy thing.
Even with OnChange you can be in the weeds with conditional formatting
http://www.experts-exchange.com/Database/MS_Access/Q_28218128.html

And the OnChange is problematic if some user starts typing in the box INSTEAD of using the DatePicker

@pabrann
You'll be a lot better off trying to get away from the operational requirement of "the exact point a date is selected in a text box" and moving to a "after a button right beside the textbox changed by the DatePicker is clicked."  Your present operational requirement is supremely difficult to execute flawlessly in all cases.

I'm just saying.  Have a look at the link

Nick67
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1800 total points
ID: 40030550
So far we are still in the grass Nick :-)

mx
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1800 total points
ID: 40045154
@pabrann
Has this been resolved ?

mx
0
 

Author Comment

by:pabrann
ID: 40046087
Yes it has, Sorry, but I thought I finalized it a number of days ago.  I'll review.
0
 

Author Closing Comment

by:pabrann
ID: 40046103
Excellent suggestions. My application is running and my client is very happy with me. I did not take credit and told them where I got the solution.

THANK YOU!!
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question