以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助查找窗口问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=172050)

--  作者:xnsiwei
--  发布时间:2021/9/20 11:07:00
--  求助查找窗口问题
求助查找窗口问题
代码如下:
Dim tbx As WinForm.TextBox = e.Form.Controls("Textfind")
Dim str As String = tbx.value
Dim dr As DataRow=DataTables("hp1").find("中类代码 =\'" &  str & "")
If dr IsNot Nothing Then
    Dim idx As Integer = Tables("中类代码").findrow(dr)
    If idx >= 0 Then
        Tables("中类代码").position= idx
    End If
End If

输入代码后出现如下错误提示:表达式包含无效的字符串常量: \'011。


--  作者:有点蓝
--  发布时间:2021/9/22 9:11:00
--  
Dim dr As DataRow=DataTables("hp1").find("中类代码 =\'" &  str & "\'")

另外查一次就行了,何必查2次:http://www.foxtable.com/webhelp/topics/0553.htm

Dim tbx As WinForm.TextBox = e.Form.Controls("Textfind")
Dim str As String = tbx.value
    Dim idx As Integer = Tables("中类代码").findrow("中类代码 =\'" &  str & "\'")
    If idx >= 0 Then
        Tables("中类代码").position= idx
    End If

--  作者:xnsiwei
--  发布时间:2021/9/23 10:22:00
--  
原来是格式错误,谢谢!