Dim dt As Date = Date.Today.AddDays(20) Dim dr As DataRow = DataTables("表A").SQLFind("日期 <= '" & dt & "'") If dr IsNot Nothing Then MessageBox.Show("有产品即将到期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Tables("表A").DataTable.LoadFilter = "日期 <= '" & dt & "'" Tables("表A").DataTable.Load MainTable = Tables("表A") End If