以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  Syscmd.Edit.Replace()得到的这个替换窗体 有没有办法自己做?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=175225)

--  作者:cnsjroom
--  发布时间:2022/2/24 10:18:00
--  Syscmd.Edit.Replace()得到的这个替换窗体 有没有办法自己做?
Syscmd.Edit.Replace()得到的这个替换窗体 有没有办法自己做?

 

主要是想有时候实现日期列值范围内的数据筛选  或者数据量内的数据筛选

 或者有没有对应的列子代码  自定义做一个类似的呢?


图片点击可在新窗口打开查看此主题相关图片如下:111.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2022/2/24 10:44:00
--  
查找下一个:http://www.foxtable.com/webhelp/topics/0552.htm


--  作者:cnsjroom
--  发布时间:2022/2/24 11:52:00
--  回复:(有点蓝)查找下一个:http://www.foxtable.co...

老师  根据你的指导  初步做了如下:

 

1、替换代码:红色部分代码如何根据匹配内容  全部内容来进行条件组合呢?

Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim cm3 As WinForm.ComboBox = e.Form.Controls("ComboBox3")
If cm3.text="匹配内容" Then
    DataTables(CurrentTable.name).ReplaceFor(cm.text,t.text, "  ")
Else If cm3.text="全部内容" Then
    DataTables(CurrentTable.name).ReplaceFor(cm.text,t.text, "  ")
End If

 

 

2、上述替换代码怎么实现指定的列名,批量全部替换呢?

 

3、查找下一个代码:开始位置  结束位置  怎么写条件呢?

Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim ck As WinForm.CheckBox = e.Form.Controls("CheckBox1")
With Tables(CurrentTable.name)
    Dim r As Integer
    If ck.Checked=True
        r = .Find(t.text, .RowSel + 1,cm.text, True, False, True)
    Else
        r = .Find(t.text, .RowSel + 1,cm.text, False, False, True)
    End If
    If cm2.text="完全匹配" Then
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
        End If
    Else  If cm2.text="开始位置" Then
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
        End If
    Else  If cm2.text="结束位置" Then
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
        End If

    Else  If cm2.text="任意位置" Then
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, False, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, False, True)
        End If
    End If
    If r > - 1 Then \'如果找到符合条件的行
        .Position = r \'则选择该行
    End  If
End With

 


--  作者:有点蓝
--  发布时间:2022/2/24 13:36:00
--  
1、
If cm3.text="匹配内容" Then
    for each dr as datarow in DataTables(CurrentTable.name).select(“点击下一个生成的查询条件”)
dr(cm.text) = dr(cm.text).replace(t.text,“新的字符”)
next
Else If cm3.text="全部内容" Then
    DataTables(CurrentTable.name).ReplaceFor(cm.text,t.text,“点击下一个生成的查询条件”)
End If
2、上面代码不就已经指定列名了吗
3、改为findrow(http://www.foxtable.com/webhelp/topics/0553.htm),条件使用like查询

--  作者:cd_tdh
--  发布时间:2022/2/24 13:37:00
--  

替换前先判断列名啊,批量:循环啊

替换那个帮助文档,后面的代码就是批量啊


--  作者:cnsjroom
--  发布时间:2022/2/24 15:31:00
--  回复:(有点蓝)1、If cm3.text="匹配内容" Then&nbs...

点击下一个代码:

 tj组合麻烦修正一下,怎么实现在开始位置  结束位置 任意位置 对应的进行查找呢?

Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim ck As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim tj As  String
With Tables(CurrentTable.name)
    Dim r As Integer
    If cm2.text="完全匹配" Then
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
        End If
    Else  If cm2.text="开始位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="结束位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="任意位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    End If
    vars("tj")=tj
    If r > - 1 Then \'如果找到符合条件的行
        .Position = r \'则选择该行
    End  If
End With

 

 

 

 

 


--  作者:有点蓝
--  发布时间:2022/2/24 15:34:00
--  
http://www.foxtable.com/webhelp/topics/0102.htm

[姓名] Like \'%赫%\'

[姓名] Like \'赫%\'

[姓名] Like \'%赫\'

分别表示姓名中包括“赫”,姓名开头是“赫”(姓赫),姓名结尾是“赫”


--  作者:cnsjroom
--  发布时间:2022/2/24 16:42:00
--  回复:(有点蓝)http://www.foxtable.com/webhelp/to...

谢谢老师 

当前代码如下:红色部分tj得到的是如  当事人=‘张三’  然后对应的table表无数据  组合字符不对 麻烦老师帮忙看看  谢谢

Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim ck As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim tb As WinForm.Table = e.Form.Controls("Table1")
Dim tj As  String
With Tables(CurrentTable.name)
    Dim r As Integer
    If cm2.text="完全匹配" Then
        tj= cm.text & "=" & "\'" & t.text & "\'"
        If ck.Checked=True
            r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
        Else
            r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
        End If
    Else  If cm2.text="开始位置" Then
        tj="[" & cm.text & "] Like \'" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="结束位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="任意位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    End If
    vars("tj")=tj
    If r > - 1 Then \'如果找到符合条件的行
        .Position = r \'则选择该行
    End  If
    MessageBox.Show(tj)
    tb.Table.Filter=tj
End With


--  作者:有点蓝
--  发布时间:2022/2/24 16:49:00
--  
都改为findrow吧。另外查询和筛选有半毛钱的关系吗
--  作者:cnsjroom
--  发布时间:2022/2/24 17:30:00
--  回复:(有点蓝)都改为findrow吧。另外查询和筛选有半...

代码如下:【运行后只能查找第一次查找到的数据,怎么修正实现可以一直查找下一个呢?】

 

 

Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim ck As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim tb As WinForm.Table = e.Form.Controls("Table1")
Dim tj As  String
With tb.Table
    Dim r As Integer
    If cm2.text="完全匹配" Then
        tj= cm.text & "=" & ""\'" & t.text & "\'""      ‘这个位置怎么组合成为  选择的列名=输入的值呢    如: “当事人=‘“ & t.text & ”’”   这个当事人是列名 由cm.text来赋值
        If ck.Checked=True    ‘区分大小写被选择’
            r =.FindRow(tj)     ‘这个地方怎么实现区分大小写呢?’

      Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="开始位置" Then
        tj="[" & cm.text & "] Like \'" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="结束位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    Else  If cm2.text="任意位置" Then
        tj="[" & cm.text & "] Like \'%" & t.text & "%\'"
        If ck.Checked=True
            r =.FindRow(tj)
        Else
            r =.FindRow(tj)
        End If
    End If
    vars("tj")=tj
    If r > - 1 Then \'如果找到符合条件的行
        .Position = r \'则选择该行
    End  If
    \'MessageBox.Show(tj)
    \'tb.Table.Filter=tj
End With

 

 

[此贴子已经被作者于2022/2/24 17:40:09编辑过]