产品表,currentchanged事件:
If Forms("关联产品").Opened() Then
Dim t As Table = Tables("关联产品_Table1")
Dim dr As DataRow
Dim id As Integer
With Tables("产品表")
If Tables("产品表").Current Is Nothing Then
t.Filter = "False"
Else
dr = DataTables("货位表").Find("产品编码 = " & "'" & e.Table.Current("产品编码") & "'")
id = dr("_Identify")
systemready = false
t.Filter = "_Identify >= '" & id-5 & "' And _Identify <= '" & id+5 & "'"
Tables("关联产品_Table1").Position = 5
systemready = true
End If
End With
End If
窗口“关联产品”的“table1”的currentchanged事件,代码如下:
If e.Table.Current Is Nothing Then
Return
End If
Dim wz As Integer
Dim dr As DataRow
dr = DataTables("产品表").Find("[产品编码] = '" & e.Table.Current("产品编码") & "'")
If dr IsNot Nothing Then
wz = Tables("产品表").FindRow(dr)
If wz >= 0 Then
systemready = false
Tables("产品表").Position = wz
systemready = true
End If
End If