MessageBox.show("名称是:" & e.Link.Name) Select Case e.Link.Name Case "今天生日员工" MessageBox.show("今日") Dim nms As String For Each dr As DataRow In DataTables("基本信息").DataRows Dim dt As Date = dr("出生日期") If dt.Month = Date.Today.Month AndAlso dt.Day = Date.Today.Day Then nms = nms & ",'" & dr("姓名") & "'" End If Next If nms > "" Then nms = nms.Trim(",") Tables("基本信息").filter = "[姓名] In (" & nms &")" End If Forms("正式工信息").Open MainTable = Tables("基本信息") Case "本周生日员工" MessageBox.show("本周") Dim ids 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 ids = ids & ",'" & dr("工号") & "'" End If Next If ids > "" Then ids = ids.Trim(",") Tables("基本信息").filter = "[工号] In (" & ids &")" End If Forms("正式工信息").Open MainTable = Tables("基本信息") Case Else MessageBox.show("名称不符,罢工了") End Select
|