Office中国论坛/Access中国论坛

标题: 如何外部数据库的报表??? [打印本页]

作者: xingzhihao    时间: 2007-11-29 20:27
标题: 如何外部数据库的报表???
如题:如何打开外部数据库的报表?
作者: andymark    时间: 2007-11-29 21:49
  1. Dim DbPath As String
  2. Dim oApp As Access.Application

  3. DbPath = "c:\db1.mdb"

  4. Set oApp = New Access.Application

  5. With oApp

  6. .Visible = True

  7. .OpenCurrentDatabase DbPath

  8. .DoCmd.OpenForm "MyForm" ' 打开窗体

  9. .DoCmd.OpenReport "MyReport", acViewPreview '打开报表

  10. .Run "MyFuncion" '执行宏
  11. End With

  12. Set oApp = Nothing
复制代码

作者: tmtony    时间: 2007-11-30 10:45
好方法,同时要注意有时要弹出式,否则报表显示不出来
作者: xingzhihao    时间: 2007-12-4 10:52
感谢二位老大!!!!!!!!!!!!!!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3