Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

Open a Form or Report in an External Database

From Wiki

Jump to: navigation, search

It is possible to open an external database and display a form or report. This example shows how to display a report.

  Sub DisplayExternalReport()
  Dim strDB
  Dim appAccess As Access.Application
      ' Initialize string to database path.
      strDB = "C:\Docs\LTD.mdb"
      ' Create new instance of Microsoft Access.
      Set appAccess = CreateObject("Access.Application")
      ' Open database in Microsoft Access window.
      appAccess.OpenCurrentDatabase strDB
      ' Open report.
      'The next code line can easily be changed to
     'appAccess.DoCmd.OpenForm "frmForm"
     'You can even add a Where statement.
      appAccess.DoCmd.OpenReport "rptReport", acViewPreview
      appAccess.Visible = True
      appAccess.UserControl = True
  End Sub

270 Rating: 1.8/5 (8 votes cast)