对记录集中的最终记录的评估不正确

时间:2019-06-25 08:57:16

标签: vba access-vba

我试图遍历一个Outlook文件夹,只带回接收时间超过表中最新数据的记录。

除了最后一条记录外,代码还适用于每条记录,由于某种原因,一旦到达第一条记录,If将其评估为true:

olItms.Item(i).ReceivedTime > dDateTime

尽管两个值都位于:19/06/2019 14:21:55

Set rs = db.OpenRecordset("SELECT EmailTime FROM tbl_EngagementData WHERE ReportID = """ & "Open Absence" & """" & " ORDER BY EmailTime DESC")

dDateTime = rs.Fields(0)

For i = olItms.Count To 1 Step -1

    If olItms.Item(i).ReceivedTime > dDateTime Then

        'Do Something

    End If

Next

我希望最后一条记录的评估结果为False。

1 个答案:

答案 0 :(得分:1)

尝试:

this.Visibility = Visibility.Hidden;
MovingObjectWindow movingObjectWindow = new 
MovingObjectWindow();
movingObjectWindow.Visibility = Visibility.Visible;