Foxtable(狐表)用户栏目专家坐堂 → 关于排考室座位号的问题


  共有5249人关注过本帖平板打印复制链接

主题:关于排考室座位号的问题

帅哥哟,离线,有人找我吗?
jhxb8821
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:618 积分:4560 威望:0 精华:0 注册:2016/4/15 22:24:00
感谢蓝老师  发帖心情 Post By:2022/1/20 10:35:00 [只看该作者]

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 = "索引顺序"
    Dim k As Integer = 1
    Dim z As Integer = 1
    For b As Integer = 0 To CurrentTable.rows.count -1
        CurrentTable.Rows(b)("考场号") = Format(k,"100")  ''默认Format(k,"000")
        CurrentTable.Rows(b)("座位号") = Format(Rand.Next(30) + b Mod e.Form.Controls("NumericComboBox1").Value,"00")
        CurrentTable.Rows(b)("座位号") = z
        CurrentTable.Rows(b)("座位号") = Format(z,"00")
        z = z + 1
        If z > 30 Then
            z = 1
            k = k + 1
        End If
    Next
End If

蓝老师,这个代码很好用,由于是前面的考场排满30人后,再排后面的考场,这个填入考场数量的"NumericComboBox1"已经没有用了,取消输入考场数量这个代码就更完美了

 回到顶部
总数 72 1 2 3 4 5 6 7 8 下一页