If Forms("高考排考室").Controls("NumericComboBox1").Value <= 0 Then
MessageBox.Show("考场号不能小等于零值!","中止操作",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
Else
Dim f As New Filler
f.SourceTable = DataTables("高考排考室")
f.SourceCols = "班级,姓名"
f.DataTable = DataTables("高考排考室")
f.DataCols = "班级,姓名"
f.ExcludeExistValue = True
f.Fill
For i As Integer = 0 To CurrentTable.rows.count -1
CurrentTable.Rows(i)("索引顺序") = Rand.Next(10000)
Next
CurrentTable.sort = "索引顺序"
For b As Integer = 0 To CurrentTable.rows.count -1
CurrentTable.Rows(b)("考场号") = Format(1 + b Mod e.Form.Controls("NumericComboBox1").Value,"100")
Next
CurrentTable.sort = "索引顺序,考场号 Asc"
'================
For b As Integer = 0 To CurrentTable.rows.count -1
CurrentTable.Rows(b)("座位号") = Format(Rand.Next(1000) + b Mod e.Form.Controls("NumericComboBox1").Value,"000")
Next