我编辑了个输入窗口,有几列的信息是必须输入才能允许保存的,我下面的代码有什么问题吗?请高手帮忙看下,代码比较啰嗦,难为你们了啊。谢谢
If e.Form.Controls("piao据编号").value IsNot Nothing And e.Form.Controls("piao据类型").value IsNot Nothing And e.Form.Controls("出piao单位").value IsNot Nothing And e.Form.Controls("piao面金额").value IsNot Nothing And e.Form.Controls("出piao日期").value IsNot Nothing And e.Form.Controls("到期日期").value IsNot Nothing And e.Form.Controls("收款单位").value IsNot Nothing And e.Form.Controls("piao据来源").value IsNot Nothing And e.Form.Controls("出piao银行").value IsNot Nothing And e.Form.Controls("piao据状态").value IsNot Nothing Then
Dim s As String = e.Form.Controls("piao据状态").value
If s = "转让" Then
If e.Form.Controls("转让单位").value IsNot Nothing Then
CurrentTable.current.save()
CurrentTable.current.locked = True
Else
MessageBox.show("转让状态下转让单位必须输入内容!")
End If
ElseIf s <> "转让" Then
If e.Form.Controls("转让单位") Is Nothing Then
CurrentTable.current.save()
CurrentTable.current.locked = True
Else
MessageBox.show("您有*必输项未输入内容或非转让状态下转让单位非法存在内容,请重新输入!")
End If
End If
End If