现在将改进后的数据库发上来,供参考
Private Sub 建议立案日期_AfterUpdate()
If IsNull(DLookup("工作日编号", "单位日历", "[日期] = #" & Me.建议立案日期 & "#")) Then
MsgBox "今天为非工作日,请选择其他日期!", vbInformation, "一般提示:"
Me.建议立案日期 = Null
Me.建议立案日期.SetFocus
Exit Sub
End If
Me.工作日编号 = DLookup("工作日编号", "单位日历", "[日期] = #" & Me.建议立案日期 & "#")
Me.立案日期 = DLookup("日期", "单位日历", "[工作日编号] = " & Me.工作日编号 + 1 & " ")
Me.告知日期 = DLookup("[日期]", "单位日历", "[工作日编号] = " & Me.工作日编号 + 2 & " ")
Me.建议处罚日期 = DLookup("[日期]", "单位日历", "[工作日编号] = " & Me.工作日编号 + 7 & " ")
Me.处罚审批日期 = DLookup("[日期]", "单位日历", "[工作日编号] = " & Me.工作日编号 + 8 & " ")
Me.处罚告知日期 = DLookup("[日期]", "单位日历", "[工作日编号] = " & Me.工作日编号 + 9 & " ")
Me.限期执行处罚日期 = DLookup("[日期]", "单位日历", "[工作日编号] =" & Me.工作日编号 + 24 & " ")
End Sub
点击下载此附件