[AccessD] Running a report in an external database

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Sat Mar 19 13:23:16 CST 2005


Dear List:

Per your instructions I added code to a client's db to run a report in an external mdb and it works just fine:

Private Sub cmdPrintMemo2Set_Click()
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE from C:\Acessdat\Reports.tUDGlobalMerge"
    DoCmd.RunSQL "INSERT INTO tUDGlobalMerge " & _
                 "IN 'C:\ACESSDAT\Reports.mdb' " & _
                 "SELECT tUDGlobalMerge.* " & _
                 "FROM tUDGlobalMerge"
                 
'Open Reports.mdb hidden, print Report and close that mdb.

Dim acc As Access.Application
Set acc = CreateObject("access.application")
acc.OpenCurrentDatabase ("c:\Acessdat\Reports.mdb")
acc.DoCmd.OpenReport "rptEvictionCase-MemoToSet", acViewNormal
acc.CloseCurrentDatabase
Set acc = Nothing

End Sub

Now I get an email from him with the following message:

********************************************
I have had a problem with the code you sent me.  When I run it (that is, have Forms.mdb print the report in Report.mdb), my computer will no longer open an access program by double clicking a mdb, either shortcut or regular, until I reboot.  

In other words, I have the mdb I run my practice with.  I have a short cut to open it on my desktop.  Once I have run the Forms.mdb, clicking on the short cut on my desktop, exploring to where the mdb actually resides and double clicking on that, all get nothing.  From the start button, I CAN open an instance of MS Access and then once it is open, open an mdb, but other than that, its as if I had unregistered all the mdbs.  ????

Seems to me that there's an object open somewhere.  If I went to the processes tab of the task manager I'll bet I'd see more than one instance of msaccess.
*******************************************

Anyway, any hints as to how to solve this one?

MTIA

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com
858-259-4334



More information about the AccessD mailing list