• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 36
  • Last Modified:

How find last date of month after entering the first date of a month

I have a form with two fields.  One is txtStartDate.  The other is txtEndDate.  If I enter 10/1/2015 in the first field I want the 2nd field to populate with the last date of the month I entered in the first field.  Or in this case, 10/31/2015.

But if I entered 2/1/2012 in the 1st field I'd want 2/29/2012 to populate the 2nd field.

What would the control source be for the 2nd field?
2 Solutions
=DateAdd('m', 1, [txtStartDate]) - 1

Open in new window

Rey Obrero (Capricorn1)Commented:
here is a formula to get the end of the month date based on the entered date


=dateserial(year( txtStartDate),Month( txtStartDate)+1,0)
SteveL13Author Commented:
They both worked and you posted within one minute of each other.  Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now