Link to home
Start Free TrialLog in
Avatar of James
JamesFlag for Canada

asked on

Is there an event when date is selected via date picker in Microsoft Access?

I have a text box for entering a date and it is set to use Access 2010's built-in date picker. Is there an event that fires when someone selects a date via the date picker? When I select a date via the date picker, it updates the date in the field but the before update and after update events of the field don't fire until I try leaving the field.

Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James

ASKER

Thanks! That's perfect.
Avatar of James

ASKER

One more question ... is there a way to distinguish in then OnChange event between a change that came from selecting a date in the date picker and a change that is the result of typing in the field? Because now it works fine if they choose a date via the date picker but if they try typing a date, the event fires with every keystroke.

What I'm trying to do is execute code when a date is entered - either be typing or via the date picker.
You could add a check in the OnChange event like this:
If IsDate(Me.NameOfDatePickerControl.Text) And Me.NameOfDatePickerControl.Text Like "*/*/####" Then

Ron