(1)关闭按钮
Private Sub cmdclose_Click()
DoCmd.Close
End Sub
(2)确定按钮
Private Sub Cmdok_Click()
Dim sql As String
If IsNull(Me.Combo0) Then
MsgBox ("请输入部门!")
Exit Sub
End If
If IsNull(Me.combo1) Then
MsgBox ("请输入员工!")
Exit Sub
End If
sql = "insert into 离职记录(部门,员工编号,离职日期,离职原因)"
'录入数据到“离职记录”
sql = sql & "values ('" & Me.Combo0 & "','" & Me.combo1 & "','" & Me.Text12 & "','" & Me.Combo2 & "')"
DoCmd.RunSQL sql
sql = "update 员工信息 set 离职=yes,离开单位时间=" & Me.Text12 & " where 员工编号='" & Me.combo1 & "'"