CurrentChanged 选择不同数据行后执行,也就是Current属性发生变化后执行
在表“LNH07"的CurrentChanged中写入如下代码
If Tables("LNH07") .Current IsNot Nothing Then
If Forms("LNHjf").Opened Then
With DataTables("LNHjf_W01")
.LoadFilter ="[GB103] = '" & Tables("LNH07") .Current("GB103")& "' And [GB000] = '" & Tables("LNH07").Current("GB000") & "'"
.load()
End With
End If
End If
If Tables("LNH07") .Current IsNot Nothing Then
If Forms("LNHjf").Opened Then
With DataTables("LNHjf_W02")
.LoadFilter ="[GB103] = '" & Tables("LNH07") .Current("GB103")& "' And [GB000] = '" & Tables("LNH07").Current("GB000") & "'"
.load()
End With
End If
End If
同时在设计窗口时在"LNHjf_W02”CurrentChanged中写入如下代码,存在当W0202表没有符合条件数据时,显示上一条(改变行之前)的数据,不能移除,求Bin老师指教!
If Tables("LNHjf_W02") .Current IsNot Nothing Then
With DataTables("LNHjf_W0202")
.LoadFilter ="[GB103] = '" & Tables("LNHjf_W02") .Current("GB103")& "' And [GS101] = '" & Tables("LNHjf_W02").Current("GS101") & "'"
.load()
End With
End If