改成
Dim r As Row = e.Table.Current
Dim f As String = "编号 = '" & r("编号") & "'"
Forms("窗口1").controls("table1").Table.DataTable.Fill("Select top 4 [_Identify],[日期],[姓名],[事宜] Flom {表A} where " & f & "And [日期] < #" & r("日期") & "# order by 日期 Desc","acc_test", True )
Dim drs = Forms("窗口1").controls("table1").Table.DataTable.Select("")
If drs.count = 1 Then
forms("窗口1").controls("table1").Table.addnew(3)
End If
If drs.count = 2 Then
forms("窗口1").controls("table1").Table.addnew(2)
End If