-- 作者:mr725
-- 发布时间:2010/2/25 19:32:00
--
试一试这个看看: Dim dr As row =tables("业务").Current Dim ColNames() AS String = "项目名称,业务类型,基准日期,作业日期,标的额,鉴定人员,报告,任务人".Split(",") For Each ColName AS String In ColNames if dr.IsNull(ColName) MessageBox.Show("请详细完整地填写 \'" & Colname & _ "\' !","存盘失败",MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 return end if Next \'8 if Forms("业务一").Controls("RadioButton2").Checked=false And _ Forms("业务一").Controls("RadioButton1").Checked=false Then MessageBox.Show("请选择委托类别!","存盘失败", _ MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 ElseIf Forms("业务一").Controls("RadioButton1").Checked=true and _ dr.isnull("委托单位") then MessageBox.Show("请选择委托或联系单位!","存盘失败", _ MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 ElseIf dr("业务类型")="交通事故" then If dr.IsNull("当事人") or dr.IsNull("车辆型号") or dr.IsNull("图片") Then Dim ColNames1() AS String = "当事人,车辆型号,图片".Split(",") For Each ColName1 as String In ColNames1 If dr.isnull(ColName1) Then MessageBox.Show("请详细完整地填写 \'" & Colname1 & _ "\' !","存盘失败",MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 End If Next End IF ElseIf dr.IsNull("当事人") Then If dr("业务类型")="房地产认证" Or dr("业务类型")="非刑事案件" Or _ dr("业务类型")="其它价格认证" then MessageBox.Show("请详细完整地填写当事人!","存盘失败", _ MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 End IF ElseIf Forms("业务一").Controls("RadioButton3").Checked=false And _ Forms("业务一").Controls("RadioButton4").Checked=false And _ Forms("业务一").Controls("RadioButton5").Checked = False then MessageBox.Show("请选择收费状态!","存盘失败", _ MessageBoxButtons.OK,MessageBoxIcon.Warning) \'提示用户 Else DataTables("业务").Save() Tables("业务").AddNew(1) MessageBox.Show("保存成功! 继续~ ","存盘") End If
|