We help IT Professionals succeed at work.

Convert Date Name to Date Number

jann3891 used Ask the Experts™
Hello Experts,
I am using Microsoft Access 2003.
I have a form with a drop down list (DateName), User selects the Month from this drop down list... January, February, March.... etc.
I also have a text box (MonthStartDate) on the same form that I want to populate with the first day of the month that the user selects.
So, if the user selects March, the text box will show 03/01/10 - which is current year.

Any ideas??

Thank you in advance.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

use switch

Owner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
How about modifying the RowSource of the dropdown list so that it contains 2 columns, the month #, and the text of the month.  Set the column width of the month # to zero, then in the after update event of the combo box, do something like:

me.txtMonthStartDate = DateSerial(Year(date), val(me.cboDateName), 1)


Perfect !!