By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,255 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,255 IT Pros & Developers. It's quick & easy.

Running a report from an external database

P: n/a
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. The
user chooses daily, weeekly, or quarterly. This all works fine. The
reports are presented in Print Preview mode so they can quickly review
and then snap and email.

I don't want to import all the objects, as then the objects (queries
and reports) will be in two places making maintenance tricky at best.

Now the users asked if I could make it so they go into the Sales
Database (the largest by far) and click "Run Daily Reports" and have
that click run the daily reports from the other 4 databases as well.

I've tried OpenDatabase, I've tried the code from google and the
knowledge base and I keep getting errors - nothing is working. I can
see the knowledgebase code is really old. KB article Q210132 is from
2002. I tried it and got "Statement invalid outside Type Block" on my
compile. I tried other variations and still get Type Block error on

This seems simple, but isn't working for me.

Saledate is in the query; getSaleDate is the date on the form to use in
the query/report.

OpenDatabase("C:\B19 Database Work\Hourly Data\HourlyData test.mdb") As
DoCmd.OpenReport "R: Daily Report Customer Sales Analysis", [Saledate]
= Me.getSaleDate

Thanks -

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.