Textbox with date format & onChange

sjr1917

Registered User.
Local time
Today, 13:51
Joined
Dec 11, 2012
Messages
47
Got an unbound textbox holding a date with an onChange that updates the WHERE clause in the RecordSource to show only records for the set date.

Works perfectly if the DatePicker is used, however, if the user enters the date by hand with each keystroke I get an error msg.

WOULD YOU...
1) dump the onChange and add a "Set" button to call the function that onChange executed?

2) add code to the onChange that doesn't let the variable pass thru to the WHERE clause & the requery UNTIL it's a full/legitimate date... ie, return focus to the textbox until the user is finished typing?

3) something else?

Thanks
 
I would probably use the after update event rather than the change event.
 
Thanks. I try that... thought I did and it only fired with a table/query update. This is just an unbound "grab the value and use it elsewhere" control.
 
It should fire if the value of the combo is changed, whether it's bound or not.
 
Thanks, Paul.
Appreciate this excellent forum... I'm moving from years of Dbase programming (vocationally) given up several years ago as the software stopped evolving, and while I'm wow'ed by all that Access can do, it's a bit overwhelming.

Am working through two 700+ page manuals (Access 2010 Programmer's Reference being the best).
 
Yes, AfterUpdate is solution. I wasn't thinking about having to move off the control before Access knew it was "after".
 

Users who are viewing this thread

Back
Top Bottom