Dim nms As String
Dim n As Integer = 6
For Each dr As DataRow In DataTables("员工").DataRows
Dim dt As Date = dr("出生日期")
Dim dt1 As New Date(Date.Today.Year, dt.Month, dt.Day)
Dim dt2 As New Date(Date.Today.AddDays(n).Year, dt.Month, dt.Day)
If (dt1 >= Date.Today AndAlso dt1 < Date.Today.AddDays(n)) OrElse (dt2 >= Date.Today AndAlso dt2 < Date.Today.AddDays(n)) Then
nms = nms & ",'" & dr("姓名") & "'"
End If
Next
If nms > "" Then
nms = nms.Trim(",")
End If Dim Pag As WinForm.TopicPage Pag = Forms("窗口5").Controls("TopicBar1").Pages("生日提醒") For Each pp As String In DataTables("员工").GetValues("姓名", "[姓名] In (" & nms & ")") Pag.Links.Add(pp, pp) Next
|