In many industries (particularly in the insurance industry), it注释：s important to know the last day of the month. To find the last day of a given month, add a text box and a command button to a form. Enter the following code in the command button:
Dim TEMP2 As Date
Dim nLastDay As Integer
TEMP2 = InputBox$("Please Enter A Date", "LastDay")
nLastDay = DatePart("d", DateAdd("M", 1, TEMP2 - DatePart("d", TEMP2)))
Text1.Text = nLastDay
When you run the application and click the button, you注释：ll be prompted for a date. Then, the program will display the last day of that month of any year.