BeforeAddDataRow:
Dim bm As DataRow = DataTables("WIFI查询资料").Find("部门 Is Null")
Dim SSID As DataRow = DataTables("WIFI查询资料").Find("SSID号 Is Null")
If bm IsNot Nothing Then
e.Cancel = True \'那么取消输入并提示用户
MessageBox.Show("部门未输入!","提示")
ElseIf SSID IsNot Nothing Then
e.Cancel = True \'那么取消输入并提示用户
MessageBox.Show("SSID号未输入!","提示")
End If
在新增窗口新增按钮中代码是:
Dim r = Tables("WIFI查询资料").AddNew \'增加一行
Dim i As String = DataTables("WIFI查询资料").Compute("max(序号)") \'取出当前最大一个数值
Dim idx As Integer
If i > "" Then
idx = val(i) +1
Else
idx =1
End If
r("序号") = ForMAT(idx,"00")\'增加一行的同时序列号+1
此主题相关图片如下:1_20190318084300.jpg
请老师帮我看一下 谢谢