老师:您好!

此主题相关图片如下:1.png

下边四个按键可以分别动态加入容器不同的表
上边的按键对应容器中的表进行"新增"或"删除"
怎样才能判断当前表?
If CurrentTable.DataTable.Name = "表A" Then
Dim dlgi As New OpenFileDialog
Dim pthi As String = ProjectPath & "Attachments\"
dlgi.Filter = "图形文件|*.bmp;*.jpg;*.gif;*.png"
dlgi.MultiSelect = True
If dlgi.ShowDialog = DialogResult.OK Then
For Each file As String In dlgi.FileNames
Tables("表A").AddNew
Dim r As Row = Tables("表A").Current
r("图片") = r("编号") & ".jpg"
FileSys.CopyFile(file,pthi & r("编号"),True)
Next
End If
elseIf CurrentTable.DataTable.Name = "表B" Then
Dim dlgi As New OpenFileDialog
Dim pthi As String = ProjectPath & "Attachments\"
dlgi.Filter = "图形文件|*.bmp;*.jpg;*.gif;*.png"
dlgi.MultiSelect = True
If dlgi.ShowDialog = DialogResult.OK Then
For Each file As String In dlgi.FileNames
Tables("表B").AddNew
Dim r As Row = Tables("表B").Current
r("图片") = r("编号") & ".jpg"
FileSys.CopyFile(file,pthi & r("编号"),True)
Next
End If
End If
点击新增没反应,都是同一个主表的不同关联表,不知是不是判断出问题?
请老师指教!
谢谢!
[此贴子已经被作者于2017/6/22 12:19:34编辑过]