Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 list boxes with dates. Box two default value driven 1st 1

Status
Not open for further replies.
Dec 5, 2005
40
US
I have two list boxes with dates in them for the user to select from.

List box 1 is the beginning date and 2 is the ending date.

When the date in box 1 is selected I want box 2 to be set to the last day of the next month.

i.e.

box 1 selection 6/1/08, result box 2 default value 7/31/08
box 1 selection 6/15/08, result box 2 default value 7/31/08
box 1 selection 5/31/08, result box 2 default value 6/30/08

Your help is appreciated.

Nick
 
If the value of the beginning date is bDate and the ending date is eDate then
Code:
eDate = DateSerial (Year(bDate), Month(bDate)+2, 0)
 
You can use:

dateserial(year(d),month(d)+2,0)

Where d is the first combobox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top