Solved

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

Posted on 2014-04-29
10
2,001 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
10 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 450 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 - Access MVP) earned 450 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
 

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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 50 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 450 total points
ID: 40030550
So far we are still in the grass Nick :-)

mx
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 450 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

864 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now