Dim t As Table = Tables("PharmacyBagWelling_Table2") With Tables("PharmacyBagWelling_Table1") If .Current Is Nothing Then t.Filter = "False" Else t.Filter = "报价单编号 = " & .Current("报价单编号") End If End With
我设置了一个窗口,有报价主档和报价明细两个副本表,想要他们建立关联(报价单编号),使得点击主档的某行记录,报价明细就显示,相应的报价单编号明细,上面的代码是写在窗口的afterload事件里,发现如果没有明细就会报错。 然后我改成下面这段代码,发现报价明细什么东西都没有,并且新增主档的时候,明细看不见 Dim t As Table = Tables("PharmacyBagWelling_Table2") With Tables("PharmacyBagWelling_Table1") If .Current Is Nothing Then t.Filter = "False" Else For Each r As Row In Tables("PharmacyBagWelling_Table2") If r.DataRow("报价单编号") = .Current("报价单编号") t.Filter = "报价单编号 = " & .Current("报价单编号") Else t.Filter = "False" End If Next End If End With
|