Foxtable(狐表)用户栏目专家坐堂 → 按ESC退出循环


  共有2660人关注过本帖树形打印复制链接

主题:按ESC退出循环

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


加好友 发短信
等级:八尾狐 帖子:1942 积分:14925 威望:0 精华:0 注册:2016/4/28 9:58:00
按ESC退出循环  发帖心情 Post By:2020/5/13 19:09:00 [只看该作者]

Dim tb1 As Table = Tables("学生信息A_table1")
tb1.Position=0
For Each r As Row In tb1.Rows
    Dim dr As DataRow = DataTables("学生信息").sqlfind("身份证件号='" & r("身份证件号") & "' and [_identify]<>'" &  r("_identify") & "'")
    Dim str As String=""
    If dr IsNot Nothing
        str= str & "身份证号与" & dr("学校名称") & dr("班级") & dr("学生姓名") & "重复;"
    End If
    If r("学籍号").length<>19
        str= str & vbcrlf & "学籍号不规范;"
    End If
   If r("户籍地址").length<=5
        str= str & vbcrlf & "户籍地址不规范;"
    End If
    r("重复情况")= str    
    With tb1
        .Position = .Position + 1
    End With
Next


老师在这个循环中我想做个按esc停止循环并退出怎么设计

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107825 积分:548476 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/5/14 8:38:00 [只看该作者]

建个退出按钮,按钮代码
vars("tc") = true

加上退出判断
Dim tb1 As Table = Tables("学生信息A_table1")
tb1.Position=0
For Each r As Row In tb1.Rows
if  vars("tc") = true then exit for
    Dim dr As DataRow = DataTables("学生信息").sqlfind("身份证件号='" & r("身份证件号") & "' and [_identify]<>'" &  r("_identify") & "'")
    Dim str As String=""
    If dr IsNot Nothing
        str= str & "身份证号与" & dr("学校名称") & dr("班级") & dr("学生姓名") & "重复;"
    End If
    If r("学籍号").length<>19
        str= str & vbcrlf & "学籍号不规范;"
    End If
   If r("户籍地址").length<=5
        str= str & vbcrlf & "户籍地址不规范;"
    End If
    r("重复情况")= str    
    With tb1
        .Position = .Position + 1
    End With
application.doevents
Next

 回到顶部