Solved

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

Posted on 2014-04-29
10
1,961 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 26

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 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

18 Experts available now in Live!

Get 1:1 Help Now