以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]文本框TextChanged报错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=123359) |
||||
-- 作者:天一生水 -- 发布时间:2018/8/13 9:53:00 -- [求助]文本框TextChanged报错 老师,见图,在文本框录入“-”时,报错;直接在单元格录入没有问题。
TextChanged 代码: Dim dr1 = DataTables("数据表").Find("[案号] = \'" & e.Form.Controls("ComboBox1").Text & "\'")
|
||||
-- 作者:有点甜 -- 发布时间:2018/8/13 11:46:00 -- datacolchanged,改成
For k As Integer = ii To val(jj) |
||||
-- 作者:天一生水 -- 发布时间:2018/9/26 8:21:00 -- 甜老师好! 我在文本框的TextChanged代码,想作为[案号]列的筛选条件。
比如:(2018)鲁01行初330、333、356-358、赔初11-12号。 上述录入完毕后,会将"(2018)鲁01行初3"、"(2018)鲁01行初33"......同时筛选出来。 怎样避免这种情况? 谢谢! ------------------------------------------------------------------------- \'\'\' Dim str As String = e.Form.Controls("TextBox2").text.replace("\\", "、").replace(",", "、") If str <> "" Then Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(\\([0-9]+\\)[鲁0-9]+)|(行初[0-9\\-]+)|(赔初[0-9\\-]+)|(行终[0-9\\-]+)|([0-9\\-]+)") Dim qz As String = "" Dim lx As String = "" For i As Integer = 0 To mc.count-1 Dim s As String = mc(i).value If i = 0 Then qz = s Else If s.StartsWith("行初") Then lx = "行初" s = s.replace("行初", "") ElseIf s.StartsWith("赔初") Then lx = "行赔初" s = s.replace("赔初", "") ElseIf s.StartsWith("行终") Then lx = "行终" s = s.replace("行终", "") End If Dim ii = 0 Dim jj = 0 If s.Indexof("-") >= 0 Then ii = s.split("-")(0) jj = s.split("-")(1) Else ii = s jj = s End If For k As Integer = ii To val(jj) \'msgbox(qz & lx & k & "号") Dim dr As DataRow dr = DataTables("送达管理").Find("[案号] = \'" & qz & lx & k & "号" & "\'") If dr IsNot Nothing Then dr("标注") = True End If Next End If Next For Each r As Row In Tables("批量增加_table1") Tables("批量增加_table1").Filter = "标注 = True" Next Else Return End If |
||||
-- 作者:有点甜 -- 发布时间:2018/9/26 8:44:00 -- 回复楼上,我测试没问题,请上传具体实例测试。 |
||||
-- 作者:天一生水 -- 发布时间:2018/9/26 11:44:00 -- 甜老师,你先复制“(2018)鲁01行初330号”进文本框,然后在“...330”后面依次录入“、”,“358”...
|
||||
-- 作者:有点甜 -- 发布时间:2018/9/26 11:48:00 -- \'\'\' Dim str As String = e.Form.Controls("TextBox1").text.replace("\\", "、").replace(",", "、") If str <> "" Then Tables("批量增加_table1").DataTable.ReplaceFor("标注", False) Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(\\([0-9]+\\)[鲁0-9]+)|(行初[0-9\\-]+)|(赔初[0-9\\-]+)|(行终[0-9\\-]+)|([0-9\\-]+)") Dim qz As String = "" Dim lx As String = "" For i As Integer = 0 To mc.count-1 Dim s As String = mc(i).value If i = 0 Then qz = s Else If s.StartsWith("行初") Then lx = "行初" s = s.replace("行初", "") ElseIf s.StartsWith("赔初") Then lx = "行赔初" s = s.replace("赔初", "") ElseIf s.StartsWith("行终") Then lx = "行终" s = s.replace("行终", "") End If Dim ii = 0 Dim jj = 0 If s.Indexof("-") >= 0 Then ii = s.split("-")(0) jj = s.split("-")(1) Else ii = s jj = s End If For k As Integer = ii To val(jj) \'msgbox(qz & lx & k & "号") Dim dr As DataRow dr = DataTables("数据表").Find("[案号] = \'" & qz & lx & k & "号" & "\'") If dr IsNot Nothing Then dr("标注") = True End If Next End If Next Tables("批量增加_table1").Filter = "标注 = True" Else Return End If |