请教老师, 下列代码的目的是转换数据源,但是到了倒数第二句 “Forms("开始界面").open” 不执行了,打开不了窗口,为什么?
Dim dlg As New openFileDialog '定义一个新的SaveFileDialog
Dim c1 As String = projectpath
dlg.initialDirectory = c1
dlg.Filter= "Access文件|*.mdb" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim s As String =""
'遍历当前属于此数据源的表
For Each dt As DataTable In DataTables
If dt.C Then
s += "|" & dt.name
End If
Next
s = s.Trim("|")
'卸载表
DataTables.Unload(s)
Dim s1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dlg.FileName & ";Persist Security Info=False"
Connections.Delete("cw")
Connections.add("cw",s1)
DataTables.load(s)
Tables("凭证录入表").Cols("科目").DropForm = "凭证录入辅助下拉窗口" '客户表的县市列也采用我们设计的下拉窗口输入数据.
Tables("凭证录入表").Cols("摘要").DropForm ="凭证录入辅助摘要下拉窗口"
Tables("负债表").Cols("报表分类B").Combolist = DataTables("科目").GetComboListString("报表分类","","科目代码")
Tables("负债表").Cols("报表分类A").Combolist = DataTables("科目").GetComboListString("报表分类","","科目代码")
Forms("开始界面").open
End If