S
Susan L
To create a report for December of the previous year, I need to reset a
"Start Date" on a form to the previous January for a cumulative report. I've
been able to change other code using Year(Date))-1, but am stumped on this
one, because for all months other than December, my current code works.
Here's what I've tried that does not work: There's a syntax error on the
first line, but I'm not sure about the second.
If(DateSerial(Year(Date()), 1, 1) Then
[Forms]![frm_Export_Metrics]![StartDate] = DateSerial(Year(Date) -
1, 12, 1)
'Resets Start Date on Export Metrics form to 1/1/yyyy
Else: [Forms]![frm_Export_Metrics]![StartDate] =
DateSerial(Year(Date), 1, 1)
End If
Any suggestions?
"Start Date" on a form to the previous January for a cumulative report. I've
been able to change other code using Year(Date))-1, but am stumped on this
one, because for all months other than December, my current code works.
Here's what I've tried that does not work: There's a syntax error on the
first line, but I'm not sure about the second.
If(DateSerial(Year(Date()), 1, 1) Then
[Forms]![frm_Export_Metrics]![StartDate] = DateSerial(Year(Date) -
1, 12, 1)
'Resets Start Date on Export Metrics form to 1/1/yyyy
Else: [Forms]![frm_Export_Metrics]![StartDate] =
DateSerial(Year(Date), 1, 1)
End If
Any suggestions?