控件太多的话,就用一个循环吧。差不多了。
dim colnames() as string = {"piao据编号", "piao据类型", "piao据类型"}
for each colname as string in colnames if e.form.controls(colname).text = "" then msgbox("您有*必输项未输入内容,请重新输入!") return end if next
Dim s As String = e.Form.Controls("piao据状态").value If s = "转让" Then If e.Form.Controls("转让单位").Text <> "" Then CurrentTable.current.save() CurrentTable.current.locked = True Else MessageBox.show("转让状态下转让单位必须输入内容!") End If ElseIf s <> "转让" Then If e.Form.Controls("转让单位").Text <> "" Then CurrentTable.current.save() CurrentTable.current.locked = True Else MessageBox.show("非转让状态下转让单位非法存在内容,请重新输入!") End If End If
|