For i As Integer = 1 To 2 If e.Form.Controls("TextBox" & i).Text = "" Then MessageBox.Show("所有录入框都不能为空") Return End If Next Tables("员工资料").AddNew() Dim s As String = DataTables("员工资料").Compute("Max(工号)", "是否离职 = False") Dim idx As Integer If s > "" Then '若有最大值,即表数据不为空 idx = CInt(s.Substring(2,3)) + 1 '提取字符串i里的数字,并加1 Else idx = 1 '若表数据为空 就=1 End If e.Form.Controls("TextBox1").Text = "WX" & Format(idx,"000")
|