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


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

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

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


加好友 发短信 一级勋章
等级:MVP荣誉狐 帖子:5154 积分:31434 威望:0 精华:8 注册:2008/9/8 12:27:00
  发帖心情 Post By:2010/5/23 10:07:00 [只看该作者]

试试这个(放在datacolchanged事件中):

dim bm as string = currenttable.current("部门编码")
Dim ls() as String
ls = bm.split("-")
If bm <> "" Then
    Select Case ls.Length
        Case 1
            currenttable.current("部门全称") = currenttable.current("部门名称")
        Case 2
            Dim dr As DataRow
            dr = DataTables("部门表").Find("部门编码 = '" & ls(0) & "'")
            currenttable.current("部门全称") = dr("部门名称") & "-" & currenttable.current("部门名称")
        Case 3
            Dim dr As DataRow
            dr = DataTables("部门表").Find("部门编码 = '" & ls(0) & "-" & ls(1) & "'")

            currenttable.current("部门全称") = dr("部门全称") & "-" & currenttable.current("部门名称")
    End Select
End If

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

 回到顶部