#第一次写代码 不懂规矩 自己捏造 不许笑话我!# 帮我看一下有没有可以改进的地方,,,,机器反应很慢啊,有时还会死机什么的 【狐表升级最新版本之前运行不会死机】
Dim v11 As String = e.Form.Controls("社区框").value
Dim v12 As String = "其他"
Dim v111 As Boolean = (v11 = v12)
Dim v112 As Boolean = (e.Form.Controls("社区其他框").value = Nothing)
Dim v21 As String = e.Form.Controls("职业框").value
Dim v22 As String = "其他"
Dim v211 As Boolean = (v21 = v22)
Dim v212 As Boolean = (e.Form.Controls("职业其他框").value = Nothing)
Dim v31 As String = e.Form.Controls("原因框").value
Dim v32 As String = "其他"
Dim v311 As Boolean = (v31 = v32)
Dim v312 As Boolean = (e.Form.Controls("原因其他框").value = Nothing)
Dim v41 As String = Tables("填报表").Current("地点")
Dim v42 As String = "其他"
Dim v411 As Boolean = (v41 = v42)
Dim v412 As Boolean = (Tables("填报表").Current.IsNull("地点为其他时填入") )
Dim v51 As String = Tables("填报表").Current("活动")
Dim v52 As String = "其他"
Dim v511 As Boolean = (v51 = v52)
Dim v512 As Boolean = (Tables("填报表").Current.IsNull("活动为其他时填入") )
Dim v61 As String = Tables("填报表").Current("性质")
Dim v62 As String = "其他"
Dim v611 As Boolean = (v61 = v62)
Dim v612 As Boolean = (Tables("填报表").Current.IsNull("性质为其他时填入") )
Dim v71 As String = Tables("填报表").Current("部位")
Dim v72 As String = "其他"
Dim v711 As Boolean = (v71 = v72)
Dim v712 As Boolean = (Tables("填报表").Current.IsNull("部位为其他时填入") )
Dim v81 As String = Tables("填报表").Current("结局")
Dim v82 As String = "其他"
Dim v811 As Boolean = (v81 = v82)
Dim v812 As Boolean = (Tables("填报表").Current.IsNull("结局为其他时填入") )
Dim v1 As Boolean =( v111 And v112 )
Dim v2 As Boolean =( v211 And v212 )
Dim v3 As Boolean =( v311 And v312 )
Dim v4 As Boolean =( v411 And v412 )
Dim v5 As Boolean =( v511 And v512 )
Dim v6 As Boolean =( v611 And v612)
Dim v7 As Boolean =( v711 And v712)
Dim v8 As Boolean =( v811 And v812 )
If Tables("填报表").Current.IsNull("监测卡编号") Then
Messagebox.Show("监测卡编号不能为空!请填入")
e.Form.Controls("监测卡编号框").Select()
ElseIf Tables("填报表").Current.IsNull("社区") Then
Messagebox.Show("社区不能为空!请填入")
e.Form.Controls("社区框").Select()
ElseIf Tables("填报表").Current.IsNull("专业组") Then
Messagebox.Show("专业组不能为空!请填入")
e.Form.Controls("专业组框").Select()
ElseIf Tables("填报表").Current.IsNull("姓名") Then
Messagebox.Show("姓名不能为空!请填入")
e.Form.Controls("姓名框").Select()
ElseIf Tables("填报表").Current.IsNull("性别") Then
Messagebox.Show("性别不能为空!请填入")
e.Form.Controls("性别框").Select()
ElseIf Tables("填报表").Current.IsNull("年龄") Then
Messagebox.Show("年龄不能为空!请填入")
e.Form.Controls("年龄框").Select()
ElseIf Tables("填报表").Current.IsNull("户籍") Then
Messagebox.Show("户籍不能为空!请填入")
e.Form.Controls("户籍框").Select()
ElseIf Tables("填报表").Current.IsNull("文化程度") Then
Messagebox.Show("文化程度不能为空!请填入")
e.Form.Controls("文化程度框").Select()
ElseIf Tables("填报表").Current.IsNull("职业") Then
Messagebox.Show("职业不能为空!请填入")
e.Form.Controls("职业框").Select()
ElseIf Tables("填报表").Current.IsNull("发生时间") Then
Messagebox.Show("发生时间不能为空!请填入")
e.Form.Controls("发生时间框").Select()
ElseIf Tables("填报表").Current.IsNull("具体因素") Then
Messagebox.Show("具体因素不能为空!请填入")
e.Form.Controls("具体因素框").Select()
ElseIf Tables("填报表").Current.IsNull("发生原因") Then
Messagebox.Show("原因不能为空!请填入")
e.Form.Controls("原因框").Select()
ElseIf Tables("填报表").Current.IsNull("地点") Then
Messagebox.Show("发生地点不能为空!请填入")
e.Form.Controls("地点框").Select()
ElseIf Tables("填报表").Current.IsNull("活动") Then
Messagebox.Show("活动不能为空!请填入")
e.Form.Controls("活动框").Select()
ElseIf Tables("填报表").Current.IsNull("意图") Then
Messagebox.Show("意图不能为空!请填入")
e.Form.Controls("意图框").Select()
ElseIf Tables("填报表").Current.IsNull("性质") Then
Messagebox.Show("性质不能为空!请填入")
e.Form.Controls("性质框").Select()
ElseIf Tables("填报表").Current.IsNull("部位") Then
Messagebox.Show("部位不能为空!请填入")
e.Form.Controls("部位框").Select()
ElseIf Tables("填报表").Current.IsNull("严重程度") Then
Messagebox.Show("程度不能为空!请填入")
e.Form.Controls("程度框").Select()
ElseIf Tables("填报表").Current.IsNull("临床诊断") Then
Messagebox.Show("临床诊断不能为空!请填入")
e.Form.Controls("临床诊断框").Select()
ElseIf Tables("填报表").Current.IsNull("主治医生") Then
Messagebox.Show("主治医生不能为空!请填入")
e.Form.Controls("主治医生框").Select()
ElseIf Tables("填报表").Current.IsNull("结局") Then
Messagebox.Show("结局不能为空!请填入")
e.Form.Controls("结局框").Select()
ElseIf Tables("填报表").Current.IsNull("回答者") Then
Messagebox.Show("回答者不能为空!请填入")
e.Form.Controls("回答者框").Select()
ElseIf Tables("填报表").Current.IsNull("填卡人") Then
Messagebox.Show("填卡人不能为空!请填入")
e.Form.Controls("填卡人框").Select()
ElseIf Tables("填报表").Current.IsNull("填卡日期") Then
Messagebox.Show("填卡日期不能为空!请填入")
e.Form.Controls("填卡日期框").Select()
ElseIf v1 = True Then
Messagebox.Show("请填入其他社区名称")
e.Form.Controls("社区其他框").Select()
ElseIf v2= True Then
Messagebox.Show("请填入其他职业")
e.Form.Controls("职业其他框").Select()
ElseIf v3= True Then
Messagebox.Show("请填入其他原因")
e.Form.Controls("原因其他框").Select()
ElseIf v4= True Then
Messagebox.Show("请填入其他地点")
e.Form.Controls("地点其他框").Select()
ElseIf v5= True Then
Messagebox.Show("请填入其他活动")
e.Form.Controls("活动其他框").Select()
ElseIf v6= True Then
Messagebox.Show("请填入其他性质")
e.Form.Controls("性质其他框").Select()
ElseIf v7= True Then
Messagebox.Show("请填入其他部位")
e.Form.Controls("部位其他框").Select()
ElseIf v8= True Then
Messagebox.Show("请填入其他结局")
e.Form.Controls("结局其他框").Select()
Else
e.Form.Controls("保存新记录").Select()
Tables("填报表").Current.Save()
Tables("填报表").Current.locked = True
For Each c As WinForm.Control In e.Form.Controls
c.Enabled=False
Next
e.Form.Controls("上一条").Enabled = True
e.Form.Controls("下一条").Enabled = True
e.Form.Controls("保存").Enabled = True
e.Form.Controls("关闭").Enabled = True
e.Form.Controls("新增").Enabled = True
e.Form.Controls("修改").Enabled = True
e.Form.Controls("删除").Enabled = True
e.Form.Controls("标题").Enabled = True
e.Form.Controls("提示").Enabled = True
e.Form.Controls("删除后保存").Visible = False
e.Form.Controls("删除后保存").Enabled = False
e.Form.Controls("保存新记录").Visible = False
e.Form.Controls("保存新记录").Enabled = False
e.Form.Controls("保存修改").Visible = False
e.Form.Controls("保存修改").Enabled = False
e.Form.Controls("上一条").Visible = True
e.Form.Controls("上一条").Enabled = True
e.Form.Controls("下一条").Visible = True
e.Form.Controls("上一条").Enabled = True
e.Form.Controls("保存").Visible = True
Dim xz As Row = Tables("填报表").current
Tables("工作记录").AddNew()
Dim hj As Row = Tables("工作记录").Current
hj("该记录所属监测卡编号") = xz("监测卡编号")
Dim dt As Date
dt = Date.Now
Tables("工作记录").Current("该记录创建时间") =dt
Dim yhming As String
yhming = User.name
Tables("工作记录").Current("该记录创建人") =yhming
Dim yhzu As String
yhzu = User.Group
Tables("工作记录").Current("该记录创建单位") =yhming
Tables("工作记录").Current.Save()
Tables("工作记录").Current.locked = True
Messagebox.Show("新增记录已保存")
End If