Foxtable(狐表)用户栏目专家坐堂 → 菜单代码运行问题


  共有2337人关注过本帖树形打印复制链接

主题:菜单代码运行问题

帅哥哟,离线,有人找我吗?
jt20002000
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:11 积分:152 威望:0 精华:0 注册:2021/10/2 20:12:00
菜单代码运行问题  发帖心情 Post By:2021/10/24 20:21:00 [只看该作者]

我根据视频学习使用菜单文本框,输入代码后显示:
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2021.5.29.1
错误所在事件:菜单,sure,Click
详细错误信息:
无法在 System.Double 和 System.String 上执行“=”操作。


Dim strf As RibbonMenu.TextBox = RibbonTabs("查询").Groups("查询").Items("finder").Items("Ttofind")
Dim Val As String = strf.Text
With CurrentTable
    Dim dr As String = .Cols(.Colsel).Name
    Dim Index As Integer = .FindRow( dr & " = '" & Val & " '", .Position + 1,True)
    If Index >= 0 Then
        .Position = Index
    End If
End With


求帮助,谢谢

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105943 积分:538784 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/24 21:22:00 [只看该作者]

如果选择的列是数值列,比如双精度,是不能添加单引号的

With CurrentTable
    Dim dr As String = .Cols(.Colsel).Name
Dim Index As Integer = -1
if .Cols(.Colsel).IsNumeric
    Index = .FindRow( dr & " = " & Val , .Position + 1,True)
elseif .Cols(.Colsel).IsString
Index = .FindRow( dr & " = '" & Val & "'", .Position + 1,True)
end if
    If Index >= 0 Then
        .Position = Index
    End If
End With

 回到顶部