以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]如何将子表中的相关内容赋值在父表中 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=62825) |
-- 作者:cqlwsam -- 发布时间:2015/1/8 15:50:00 -- [求助]如何将子表中的相关内容赋值在父表中 如图: 父表:辅助资料基本表,其中列“辅助资料”是备注字段 字表:通过PatientsID 筛选而来,其中列“资料”是备注字段,保存的是相关的各种文件,一条记录一个文件。 现在如何将病例的所有资料文件赋值给父表中的“辅助字段”,并想该患者在字表进行的任何操作,只要文件改变,父表中的“辅助资料”也同步改变。 谢谢!
|
-- 作者:Bin -- 发布时间:2015/1/8 15:54:00 -- 表达式引用 |
-- 作者:有点甜 -- 发布时间:2015/1/8 15:56:00 -- 你问过了啊,循环子表,合并内容,赋值给父表啊。
这个是一条记录的 http://www.foxtable.com/help/topics/1453.htm
|
-- 作者:cqlwsam -- 发布时间:2015/1/9 11:13:00 -- 再问一下,datachanged事件是写在父表中,还是子表中。谢谢! |
-- 作者:Bin -- 发布时间:2015/1/9 11:14:00 -- 子表 |
-- 作者:cqlwsam -- 发布时间:2015/1/9 11:15:00 -- 谢谢。我试试。 |
-- 作者:cqlwsam -- 发布时间:2015/1/9 11:43:00 -- [求助]如何将子表中的相关内容赋值在父表中 If e.DataCol.Name = "资料" Then Dim t As Table = Tables("辅助资料基本表") Dim txt As String Dim txt1 As String = t.Current("辅助资料") If dr("PatientsID") IsNot Nothing Then Dim drs As List(Of DataRow) = DataTables("辅助资料") For Each dr As DataRow In drs txt= txt & dr("资料") & vbcr & vbcf Next txt1=txt End If End If 其中: 这句代码过不了,怎么改:Dim drs As List(Of DataRow) = DataTables("辅助资料") 字表中的数据已经通过currentchanged进行了筛选,就是所有需要的数据。谢谢!
|
-- 作者:Bin -- 发布时间:2015/1/9 11:46:00 -- "辅助资料" 是子表? Dim drs As List(Of DataRow) = t.Current.datarow.GetChildRows("辅助资料")
|
-- 作者:cqlwsam -- 发布时间:2015/1/9 11:51:00 -- [求助]如何将子表中的相关内容赋值在父表中 “辅助资料”是字表,但我建立的模拟关联。没有建立关联表的那种。 修改后提示:
[此贴子已经被作者于2015-1-9 11:51:47编辑过]
|
-- 作者:有点甜 -- 发布时间:2015/1/9 11:52:00 -- If e.DataCol.Name = "资料" Then Dim txt As String = "" If e.DataRow.Isnull("PatientsID") = False Then Dim drs As List(Of DataRow) = DataTables("辅助资料").Select("PatientsID = \'" & e.DataRow("PatientsID") & "\'") For Each dr As DataRow In drs txt = txt & dr("资料") & vbcrlf Next e.DataRow("辅助资料") = txt End If End If |