?
Solved

open a report from an external DB

Posted on 2003-03-03
6
Medium Priority
?
249 Views
Last Modified: 2013-12-05
I have 2 DB's one that is an mde and the other is mdb.  the mdb has a report that needs to be opened in design view. I'm looking a method that will open the mdb from within the mde and then open the rpt in design within the mdb print the report and then close the mdb.  as you probably realize, I need to do this because you can't open a report in design view under an mde.
0
Comment
Question by:SE081398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 600 total points
ID: 8063250
Have a look here:
http://www.mvps.org/access/reports/rpt0012.htm

Just modify the .DoCmd.OpenReport line to open the report in design view and then do whatever you need with it.
0
 
LVL 3

Author Comment

by:SE081398
ID: 8065222
Let me rephrase my original question by answering yours.

this is what I have currently.

Set RptDB = OpenDatabase(GetDBPath & "IntRpt.mdb", False, False)
With RptDB
    DoCmd.OpenReport RptName, acViewDesign
    'varGroupLevel = CreateGroupLevel("qry invoices", "invoicedate", True, True)
End With

If thefield <> "" Then
    Create_Report_Cntl thefield 'create the controls to be added.
End If
If thegroup <> "" Then
    Create_Group thegroup, Total
End If

If thetitle <> "" Then
    With Reports(RptName)
        !rptlabel.Caption = thetitle
    End With
End If


this code is in my mde what I need to do is open the intrpt.mdb where the report is.  docmd looks for a report in the existing mde and can't find it and causes an error.  I need to be able to open the specified report within intrpt.mdb from within my mde, make sense?
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8065647
Look at the code in the link I gave you. It uses a With statement to operate the DoCmd statement in the external database, which is opened with <application object>.OpenCurrentDatabase()
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 3

Author Comment

by:SE081398
ID: 8066498
My sincerest applologies.  I'm stressed and didn't bother to investigate the link the first time.  I saw the docmd statement and thought you didn't understand my question.  Again I'm sorry.  Your link is perfect.

thank you.
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8066793
No probs, hope it helps you achieve what you need.
0
 
LVL 3

Author Comment

by:SE081398
ID: 8066833
Yes it has.  I've modified a bumnch of stuff but so far things are looking good.  However, during my extensive modification Access experienced a GPF and I lost all me changes :(:(  1 hour of great code down the crapper.

Thanks again for your help.

0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question