Solved

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

Posted on 2014-04-29
10
2,060 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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 - Microsoft MVP, Access and Data Platform) 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Ever wondered why Windows 8 and 10 don't seem to accept your GPO-based software deployment while Windows 7 does? Read on.
With Windows evolving further, the built-in protective mechanisms get better and better. Still, Microsoft is not very good at introducing those to the technical community. This article is about a new bitlocker functionality that could revolutionize …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

807 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