Dim dt As DataTable
Dim cmd As new SQLCommand
Dim ids As String
Dim box2 As WinForm.ComboBox= e.Form.Controls("ComboBox2")
Dim m As Byte = cbyte (box2.text)
cmd.CommandText = "Select [_Identify],部门,姓名,出生年月 From {基本信息} where month(出生年月)=" & m
dt = cmd.ExecuteReader
For Each dr As DataRow In dt.dataRows
ids = ids & "," & dr("_identify")
Next
ids = "(" & ids.trim(",") & ")"
ids = "Select [_Identify],部门,姓名,出生年月 From {基本信息} Where [_Identify] in " & ids
Tables("本月生日员工_Table1").Fill(ids,"",False)
Tables("本月生日员工_Table1").AllowEdit = False
帮你贴出来了
<!--EndFragment-->
[此贴子已经被作者于2013-4-18 15:19:29编辑过]