已经实现了,有些录入单位后点击退出!!!
Dim A As String
A = e.Form.Controls("单位名称").Value
Dim B As String
B = e.Form.Controls("姓名").Value
Dim C As String
C = e.Form.Controls("身份证号").Value
Dim D As String
D = e.Form.Controls("性别").Value
Dim FF As String
FF = e.Form.Controls("ComboBox1").Value
if A = "" then
if MessageBox.Show("你未录入单位名称,你是否要退出本录入窗口?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes then
DataTables("人事工资管理").DeleteFor("[单位名称] Is Null ")
For Each dt As DataTable In DataTables
dt.Save()
Next
Forms("数据录入窗口").Close()
Return '终止代码的执行
Else
if A = "" then
MessageBox.Show("请你重新录入单位名称!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
END IF
END IF
Else
if A = "" then
MessageBox.Show("请你重新录入单位名称!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
if B = "" then
MessageBox.Show("人员姓名不能为空,请录入人员姓名以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
if C = "" then
MessageBox.Show("人员身份证号不能为空,请录入人员身份证号以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
If e.Form.Controls("出生日期").Value Is Nothing then
MessageBox.Show("人员出生日期不能为空,请录入人员出生日期以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
if D = "" then
MessageBox.Show("人员性别不能为空,请录入人员性别以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
If e.Form.Controls("参加工作时间").Value Is Nothing then
MessageBox.Show("人员参加工作时间不能为空,请录入人员参加工作时间以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
if FF = "" then
MessageBox.Show("人员现任职务不能为空,请录入人员现任职务以后再退出!!!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
Return '终止代码的执行
Else
For Each dt As DataTable In DataTables
dt.Save()
Next
Forms("数据录入窗口").Close()
End If
END IF
END IF
End if
End if
End if
End if
End if