Here's what I've tried but it isn't working. Is there a way I can do it? Or is it just another nutty idea I should abandon?
Code: Select all
Private Sub txtEndDate_BeforeUpdate(Cancel As Integer)
Dim lYear As Long
Dim lMonth As Long
Dim lMonth2 As Long
Dim lDay As Long
If Not IsNull(Me.txtEndDate) Then
If IsDate(Me.txtEndDate) Then
lYear = Year(Me.txtEndDate)
lMonth = Month(Me.txtEndDate)
lMonth2 = DateAdd("m", 1, lMonth)
lDay = Day(DateSerial(lYear, lMonth2, 0))
Me.txtEndDate = DateSerial(lYear, lMonth, lDay)
End If
End If
End Sub