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

Help! External Databases

P: n/a
I am 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
compile.

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
Database
DoCmd.OpenReport "R: Daily Report Customer Sales Analysis", [Saledate]=
Me.getSaleDate

Thanks so much

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.