窗口1打印按钮代码:
Dim doc As PrintDoc = e.Form.GernatePrintDoc()doc.Preview()
Forms("窗口2").open()
Forms("窗口2").Controls("打印按钮").PerformClick()