dim isdo as boolean = true
For Each c As WinForm.Control In e.Form.Controls '遍历窗口控件
'判断指定的两种类型控件的内容是否为空
If c.Gettype.Name = "TextBox" AndAlso e.Form.Controls(c.Name).Text = "" Or c.Gettype.Name = "ComboBox" AndAlso e.Form.Controls(c.Name).Text = "" Then
MessageBox.Show("[" + c.Name + "]" + "不能为空,请输入","提示") '提示为空的控件名称(建议在控件属性处将控件名称改为提示名称,这样提示会更直观)
e.Form.Controls(c.Name).Select() '定位到该控件输入框内
isdo=false
Exit For
End If
Next
if isdo then
Tables("材料信息").AllowEdit = False '锁定表
Tables("材料信息").Current.Save() '保存指定表当前行数据
end if