Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim c1 As WinForm.ComboBox
Dim c2 As WinForm.TextBox
c1 = e.Form.Controls("ComboBox1")
c2 = e.Form.Controls("TextBox1")
Dim s1 As String = c1.Value
Dim s2 As String = c2.Value
Dim r As Integer
If s2 IsNot Nothing Then
Select Case s1
Case "物料号"
r = Tables("库存").FindRow("[物料号] = " & s2, 0, True)
If r >= 0 Then
CurrentTable.Position = r
Else
MessageBox.Show(" 输入的物料号不存在!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Case "物料名称"
r = Tables("库存").FindRow("[物料名称] = " & s2 , 0, True)
If r >= 0 Then
CurrentTable.Position = r
Else
MessageBox.Show(" 输入的物料名称不存在!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End Select
Else
MessageBox.Show(" 请输出查找内容!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
一直在 r = Tables("库存").FindRow("[物料名称] = " & s2 , 0, True)
这行出错。。不懂了
r = Tables("库存").FindRow("[物料名称] = " & s2 , 0, True)
r = Tables("库存").FindRow("[物料号] = " & s2, 0, True)
两条代码都一样的,为什么一条出错,一条没出错。。
狐爸在不
r = Tables("库存").FindRow("[物料名称] = " & s2 , 0, True)
r = Tables("库存").FindRow("[物料号] = " & s2, 0, True)
两条代码都一样的,为什么一条出错,一条没出错。。
物料名称、物料号这两个字段类型? 如果是字符型,那么:" & s2 改为: '" & s2 & "'
另外:If s2 IsNot Nothing Then 不知道对不,我都是If s2 > "" Then 或 If s2 <> "" Then 这样用的。
谢谢楼上大哥指导,问题解决了,确实如此, NOthing 判断没问题。就是奇怪,本来S2变量带的就是字符类型,怎么还加单引号''。。。。