父表与子表同步加载公式报错? Post By:2011/11/29 16:32:00 [显示全部帖子]
父表与子表同步加载,总人事库是父表,职称记录是子表。在父表的AfterLoad中设置公式如下:
If DataTables("总人事库").DataRows.Count = 0 Then '如果总人事库没有数据 DataTables("职称记录").LoadFilter = "身份证号码 Is Null" '不加载职称记录
Else Dim ids As String For Each dr As DataRow In DataTables("总人事库").DataRows ids = ids & "," & dr("拼音") Next ids= ids.Trim(",") DataTables("职称记录").LoadFilter = "拼音 In (" & ids & ")" End If DataTables("职称记录").Load()