以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  無法在 System.Int32 和 System.String 上執行 '=' 作業。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=38240)

--  作者:tungwun
--  发布时间:2013/7/23 22:01:00
--  無法在 System.Int32 和 System.String 上執行 '=' 作業。
用那代码错误信息
Dim Filter As String

With e.Form.Controls("TextBox16")
    
If .text IsNot Nothing Then
        
Filter="單號 =\' " & .text & "\'"
    
End If

End With

If Filter > "" Then
    
Tables("收據").Filter = filter

End If

With Tables("收據") 
       .Position = .Rows.Count - 1
End With
出现错误信息?
NET Framework 版本:2.0.50727.5472
Foxtable 版本:2013.6.28.1
错误所在事件:
详细错误信息:
無法在 System.Int32 和 System.String 上執行 \'=\' 作業。


--  作者:lsy
--  发布时间:2013/7/24 8:03:00
--  
Filter="單號 =\' " & .text & "\'"

單號是什么数据类型?

 


--  作者:狐狸爸爸
--  发布时间:2013/7/24 8:43:00
--  

呵呵,根据错误提示,你的单号应该是数值型,所以:

 

Filter="單號 =\' " & .text & "\'"

 

改为:

Filter="單號 = " & .text

 

建议看看:

 

http://www.foxtable.com/help/topics/1284.htm

 


--  作者:tungwun
--  发布时间:2013/7/24 16:30:00
--  是整数型
是整数型
--  作者:tungwun
--  发布时间:2013/7/24 16:36:00
--  語法錯誤: '=' 運算子之後遺漏運算元。
改代 Filter="單號= " & .text   後出现
語法錯誤: \'=\' 運算子之後遺漏運算元。
--  作者:狐狸爸爸
--  发布时间:2013/7/24 17:26:00
--  

Dim Filter As String
With e.Form.Controls("TextBox16")
    If .Value IsNot Nothing Then
        Filter="單號 = " & .Value
    End If
End With
If Filter > "" Then
    Tables("收據").Filter = filter
End If
With Tables("收據")
    .Position = .Rows.Count - 1
End With

 

如果还是不行,做个例子发上来