一段按钮代码,填充表,要求在现有代码的基础上,增加一列日期,填充变量为 yd 的月底日期,填充的行数与所填充的表相同。该代码应该如何修改,请各位老师帮助指教,谢谢!!
Dim dw As String = Forms("劳动报酬").Controls("ComboBox1").Text '单位
If dw = "" Then
MessageBox.Show("请选择单位","提示")
Return
End If
Dim mydate As Date = Forms("劳动报酬").Controls("DateTimePicker1").Text
Dim y As Integer = mydate.Year
Dim m As Integer = mydate.Month
Dim Days As Integer = Date.DaysInMonth(y,m)
Dim yd As Date = New Date(y,m,Days) '月底日期
Dim yc As Date = New Date(y,m,1) '月初日期
'删除所有行
DataTables("劳动报酬").DeleteFor("[序号] < 999999")
'填充表
Dim f As New Filler
f.SourceTable = DataTables("名册清单") '指定数据来源
f.SourceCols = "序号,编号,姓名,单位" '指定数据来源列
f.DataTable = DataTables("劳动报酬") '指定数据接收表
f.DataCols = "序号,编号,姓名,单位" '指定数据接收列
f.Filter="[单位]= '"& dw & "' and [止日]>= '"& yc & "'" '条件
f.ExcludeExistValue = True
f.Fill() '填充数据
[此贴子已经被作者于2011-10-12 18:32:19编辑过]