Hello,
I have the following function to return the first date of the selected month, which it's getting the value of the selected month from txtDateOfPlan.
apparently it's returning the first date of the current monthly what ever the selection is.
Your kind support please
Regards
Function FirstDayInMonth(Optional dtmDate As Variant) As Date
If IsMissing(dtmDate) Then
dtmDate = Date
Else
dtmDate = txtDateOfPlan
End If
FirstDayInMonth = DateSerial( _
Year(dtmDate), Month(dtmDate), 1)
End Function
Private Sub txtDateOfPlan_AfterUpdate()
txtDateOfPlan = FirstDayInMonth
End Sub
I have the following function to return the first date of the selected month, which it's getting the value of the selected month from txtDateOfPlan.
apparently it's returning the first date of the current monthly what ever the selection is.
Your kind support please
Regards
Function FirstDayInMonth(Optional dtmDate As Variant) As Date
If IsMissing(dtmDate) Then
dtmDate = Date
Else
dtmDate = txtDateOfPlan
End If
FirstDayInMonth = DateSerial( _
Year(dtmDate), Month(dtmDate), 1)
End Function
Private Sub txtDateOfPlan_AfterUpdate()
txtDateOfPlan = FirstDayInMonth
End Sub