|
日期起止全方位
'1;今年;2;这个月;3;上个月;4;去年;5;所有;6;今年上半年;7;今年下半年;8;今年一季度;9;今年二季度;10;今年三季度;11;今年四季度;12;去年一季度;13;去年二季度;14;去年三季度;15;去年四季度
Select Case Me.Combo10
Case 1
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())+1, 1, 0)"
Case 2
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), Month(Now()), 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), Month(Now()) + 1, 0)"
Case 3
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), Month(Now())-1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), Month(Now()), 0)"
Case 4
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())-0, 1, 0)"
Case 5
Me.开始日期.ControlSource = "=DMIN('日期','明细帐务资料')"
Me.结束日期.ControlSource = "=DMAX('日期','明细帐务资料')"
Case 6
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 7, 0)"
Case 7
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 7, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())+1, 1, 0)"
Case 8
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 4, 0)"
Case 9
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 4, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 7, 0)"
Case 10
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 7, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 10, 0)"
Case 11
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 10, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())+1, 1, 0)"
'12;去年一季度;13;去年二季度;14;去年三季度;15;去年四季度;16;去年上半年;17;去年下半年;
Case 12
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())-1, 4, 0)"
Case 13
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 4, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())-1, 7, 0)"
Case 14
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 7, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())-1, 10, 0)"
Case 15
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 10, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 1, 0)"
Case 16
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())-1, 7, 0)"
Case 17
Me.开始日期.ControlSource = "=DateSerial(Year(Now())-1, 7, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 1, 0)"
'20;今年1月份;21;今年2月份;22;今年3月份;23;今年4月份;24;今年5月份;25;今年6月份;26;今年7月份;27;今年8月份;28;今年9月份;29;今年10月份;30;今年11月份;31;今年12月份;
Case 20
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 1, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 2, 0)"
Case 21
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 2, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 3, 0)"
Case 22
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 3, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 4, 0)"
Case 23
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 4, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 5, 0)"
Case 24
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 5, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 6, 0)"
Case 25
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 6, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 7, 0)"
Case 26
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 7, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 8, 0)"
Case 27
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 8, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 9, 0)"
Case 28
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 9, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 10, 0)"
Case 29
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 10, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 11, 0)"
Case 30
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 11, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now()), 12, 0)"
Case 31
Me.开始日期.ControlSource = "=DateSerial(Year(Now()), 12, 1)"
Me.结束日期.ControlSource = "=DateSerial(Year(Now())+1, 1, 0)"
End Select |
|