473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Send a report from one access database via another access database

158 100+
I have a client that has all their reports, data, and code in Access 2000...They also have a copy of Access 2007 that they want to copy or somehow trigger a report in access 2000 and email it to 150 employees since emailing in access 2007 is much easier and more robust than it was in access 2000.

Just in case this gets confusing, they are wanting to press a button in access 2007, which emails ReportA from access 2000. Let me know if I need to clarify anything, and thanks in advance!

Jollywg
Apr 24 '11 #1
6 2373
ADezii
8,834 Expert 8TB
Here is how you can E-Mail a Report from an External Database (Access 2000) from the Current Database (Access 2007):
  1. Declare a Modular Level Variable to hold an Access Application Object:
    Expand|Select|Wrap|Line Numbers
    1. Dim appAccess As Access.Application
  2. Execute the Code that will actually E-Mail the Report in the External DB:
    Expand|Select|Wrap|Line Numbers
    1. Dim strDB As String
    2.  
    3. 'Initialize Constant to External Database Path
    4. Const conDB_PATH As String = "C:\Test\"
    5.  
    6. 'Initialize Variable to Absolute PATH to External Database
    7. strDB = conDB_PATH & "Phone Numbers.mdb"
    8.  
    9. 'Create New instance of Microsoft Access.
    10. Set appAccess = CreateObject("Access.Application")
    11.  
    12. 'Open External Database in Microsoft Access Window (will not be Visible by Default)
    13. appAccess.OpenCurrentDatabase strDB
    14.  
    15. 'E-Mail the Report named rptTest in the External Database to FredFlinstone@prehistoric.org, in Excel (*.xls) Format
    16. 'Subject = 'Report Name', Message Text = 'Here is the Requested Report'. The E-Mail will be
    17. 'sent directly bypassing the Edit Window (last False Argument)
    18. appAccess.DoCmd.SendObject acSendReport, "rptTest", acFormatXLS, "FredFlinstone@prehistoric.org", , , "Report Name", _
    19.                            "Here is the Requested Report", False
  3. At some point, Close the External (not Current) Database, while leaving the Current Database in tact:
    Expand|Select|Wrap|Line Numbers
    1. appAccess.CloseCurrentDatabase
P.S. - This has only been tested between Access 2003 Databases, and is fully operational as such. I made the assumption that the Logic will also work between Access 2000 <==> 2007, but only you can let us know for sure.
Apr 24 '11 #2
Jollywg
158 100+
ADezii, thank you for the quick reply! I do have one concern, will this cause a pop up box to disply when the message sends stating "A program is trying to send mail on your behalf..."?

Thanks
Jolly
Apr 25 '11 #3
ADezii
8,834 Expert 8TB
@Jollywg:
I do have one concern, will this cause a pop up box to disply when the message sends stating "A program is trying to send mail on your behalf..."?
If Microsoft Outlook is your Default E-Mail Client, it probably will. Is this your case? There is a work-a-around if this is your situation.
Apr 25 '11 #4
Jollywg
158 100+
Adezii, I am running into a small hold up. The database my client has uses Workgroup Authentication. I have the username and password for an administrator, I just need to specify that when it does the appAccess.OpenCurrentDatabase strDB
Apr 27 '11 #5
ADezii
8,834 Expert 8TB
You may have hit a brick wall on this one, since the OpenCurrentDatabase() Method has no built-in mechanism to allow for Workgroup Authentication. Off the top of my head, I know of no other approach that would accomplish exactly what you are requesting, but I will put my Thinking Cap back on! (LOL).
Apr 27 '11 #6
Jollywg
158 100+
Hmmmm....lets change gears a little bit. If I manually export the report as a .scp or .pdf can I email it from access 2007/10?
Apr 29 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bob Murdoch | last post by:
I'm using IIS on W2k, using ODBC access to the database (which is on the same server as IIS). The system is designed to generate reports from users after they have walked thru a few pages,...
2
by: nickel | last post by:
I can access Microsoft Access database via ODBC on windows 2000 using C++ . Now, I would like to use the SAME piece of code to access MS SQL on Windows. Can I achieve this without any...
3
by: Wayne | last post by:
Hi, I am new to Access and have been asked to create a new report for an exisiting database. I have done this but when I view the reports certain records are missing. Please could you...
2
by: Galina | last post by:
Hello I already initiated a thread with the same name on 22/03/2004. Thank you everyone who answered me. I wanted to link to that thread, but somehow there was no "Post follow on article"...
0
by: saraqpost | last post by:
I am somewhat new to Access and especially to forms and code. I have a form in each of 5 databases that allows the user to enter the date and then automatically run all the reports for that date....
2
by: MLH | last post by:
Here is the code. I got it off the MicroSoft site (for Access 2.0) and modified a few lines per recommendation of some of you in this newsgroup. This code runs fine in Access 2.0, but not at all...
1
by: cdolphin88 | last post by:
Hello, I'm new in creating report in Ms-Access and I have some questions. I want to display a text Hong Kong Dollars when a field in my database is = "HKD" and display a text Patacas when this...
4
by: Macca | last post by:
Hi, I have an windows forms application that accesses a SQL database I have a few questions as to connecting to the database. This application will run 24 hours a day. It is a monitoring...
2
by: piyush1.mehta | last post by:
I am new to MS Access database and want to accomplish following. I have a database and report in MS Access 2003. There are multiple users who wants to access and generate their respective reports...
5
by: Linds | last post by:
I have a report within my access database that I would like to have a shortcut on my desktop that could bring up that report. In other words, now I have to double click on the database, then go...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.