ComboBox1存放的是文件名
我想用ComboBox1的报告模板生成报告
报告的文件名由名称列和编号列组合而成
With e.Form.Controls("ComboBox1")
Dim cAb As String = .Value
Dim tm As String = "Z:\Attachments\" & cAb
Dim rs As List(of Row) = Tables("1").GetCheckedRows
If rs.Count > 0 Then '如果存在符合条件的行
For Each r As Row In rs
Dim A1 As String =e.DataRow("名称")
Dim A2 As String =e.DataRow("编号")
Dim bgwjm As String = "Z:\Reports\" & A1 & "-" & A2 & ".doc"
Dim adf As New WordReport(Tables("1"),tm,bgwjm) '定义一个WordReport
adf.BuildOne(r)
Next
adf.Show()
End If
错误显示是变量ADF没有被指定
End With