Foxtable(狐表)用户栏目专家坐堂 → [求助]求一个简单的自动填表实例


  共有13893人关注过本帖平板打印复制链接

主题:[求助]求一个简单的自动填表实例

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


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2010/5/23 10:41:00 [只看该作者]

这样不报错:

 

Select Case e.DataCol.Name
    case "部门编码","部门名称"
        Dim dr As DataRow
        dim bm as string = currenttable.current("部门编码")
        Dim ls() as String
        ls = bm.split("-")
        If bm <> "" Then
            If ls.Length<=1 Then
                currenttable.current("部门全称") = currenttable.current("部门名称")
            Elseif ls.Length<=2 Then
                dr = DataTables("部门表").Find("部门编码 = '" & ls(0) & "'")
                if dr IsNot Nothing Then
                    currenttable.current("部门全称") = dr("部门名称") & "-" & currenttable.current("部门名称")
                End If
            ElseIf ls.Length<=3 Then
                dr = DataTables("部门表").Find("部门编码 = '" & ls(0) & "-" & ls(1) & "'")
                if dr IsNot Nothing Then
                    currenttable.current("部门全称") = dr("部门全称") & "-" & currenttable.current("部门名称")
                End If
            End if
        End If
End Select

[此贴子已经被作者于2010-5-23 10:46:16编辑过]

 回到顶部