以下是引用8月32号在2009-7-10 9:45:00的发言: For Each tb As Table In Tables For Each frm As WinForm.Form In Forms If frm.TableName = tb.name Then frm.Close() End If Next Next
呵呵,重复了,既然关闭所有窗口,应该:
For Each frm As WinForm.Form In Forms frm.Close() Next
如果关闭指定表的窗口:
For Each frm As WinForm.Form In Forms if frm.TableName = "表A" frm.Close() end if Next