Foxtable(狐表)用户栏目专家坐堂 → 如何返回父表关联行,再执行按钮命令


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

主题:如何返回父表关联行,再执行按钮命令

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


加好友 发短信
等级:小狐 帖子:307 积分:2252 威望:0 精华:0 注册:2013/2/28 9:05:00
如何返回父表关联行,再执行按钮命令  发帖心情 Post By:2015/8/12 9:31:00 [只看该作者]

如图

父表和子表已经建立了 父表.推荐测评号=子表.推荐号  的关联,现在想实现:点击按钮“印”时,取定父表的当前关联行,再执行生成excel任务。



目前按钮“印”的代码:

'自动判断使用excel模板
If Tables("父表").Current IsNot Nothing Then
    Dim txt As String = Tables("父表").Current("类型").SubString(2)
    Dim path As String
    If txt = "会议推荐" Or txt = "二次推荐"  Then
        path = "Attachments\推荐登记表.xls"
    Else If txt = "谈话推荐"  Then
        path = "Attachments\谈话推荐登记表.xls"
    Else
        msgbox("没有相应的Excel模板!")
    End If
    If path > "" Then
        Dim Book As New XLS.Book(ProjectPath & path)
        Dim fl As String = ProjectPath & "Reports\推荐登记表.xls"
        Book.Build() '生成细节区
        Book.Save(fl) '保存工作簿
        Dim Proc As New Process '打开工作簿
        Proc.File = fl
        Proc.Start()
    End If
End If

 回到顶部