Select Case e.DataCol.Name Case "日期","编号" Dim dr As DataRow = e.DataRow Dim pr As DataRow If dr.IsNull("日期") OrElse dr.IsNull("编号") Then dr("姓名") = Nothing Else Dim filter As String filter = "编号 = \'" & dr("编号") & "\' And 日期 >= #" & dr("日期") & "#" pr = DataTables("表A").Find(filter) If pr IsNot Nothing Then dr("姓名") = pr("姓名") End If End If End Select