此主题相关图片如下:11.jpg
我想设计选定一个单位后执行点击按钮的操作,请帮我修改下代码:
Dim dw As WinForm.ComboBox = e.Form.Controls("单位")
Dim t As Table = Tables("生成村级一览表")
t.DataTable.DataRows.Clear
Dim drs As List(Of DataRow) = DataTables("出生").Select("单位名称 = '" & dw.Text & "'")
For Each dr As DataRow In drs
If DataTables("生成村级一览表").Find("单位 = '" & dr("单位名称") & "' And 组名称 = '" & dr("组名称") & "'") Is Nothing Then
Dim r As Row = t.AddNew
r("单位") = dr("单位名称")
r("组名称") = dr("组名称")
Dim filter As String = "单位名称 = '" & dr("单位名称") & "' And 组名称 = '" & dr("组名称") & "'"
中间省略(r("总人口数") =)
Next
Dim nr As Row = MainTable.AddNew
nr("单位") = "合计"
For i As Integer = 2 To MainTable.Cols.Count - 1
nr(MainTable.Cols(i).Name) = MainTable.Compute("Sum(" & MainTable.Cols(i).Name & ")")
Next
[此贴子已经被作者于2012-11-29 17:51:00编辑过]