[AccessD] Contralling a second mdb from the first mdb

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Mon Mar 7 00:16:50 CST 2005


I got this from Michael Mattys:

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

and it worked.  Problem solved.

Thanks and regards,

Rocky

----- Original Message ----- 
From: "MartyConnelly" <martyconnelly at shaw.ca>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Sunday, March 06, 2005 9:37 PM
Subject: Re: [AccessD] Contralling a second mdb from the first mdb


> Do you have a reference set to C:\Acessdat\xReports.mdb
> But this is where you may come a cropper on deployment,  because the 
> reference may not be correct.
> and cannot be modified in an mde
> It will search the library mdb first for the name.of the report
> also this command  must execute from within  a subroutine in the library 
> mdb that has the report and you can call the
> subroutine name from the main mdb.
>
> DoCmd.OpenReport "rptEvictionCase-MemoToSet", acViewPreview
>
> Rocky Smolin - Beach Access Software wrote:
>
>> Trying to run a report in a second database from the first database I 
>> tried
>>
>> DoCmd.OpenReport 
>> "C:\Acessdat\xReports.Reports!rptEvictionCase-MemoToSet", acViewPreview
>>
>>
>> Where xReports is the name of the mdb with the report I'm trying to run 
>> from an mdb called Forms.mdb, but the syntax is incorrect.
>>
>> Does anyone know the correct syntax?
>>
>> MTIA
>>
>> Rocky Smolin
>> Beach Access Software
>> http://www.e-z-mrp.com
>> 858-259-4334
>> ----- Original Message ----- From: "Rocky Smolin - Beach Access Software" 
>> <bchacc at san.rr.com>
>> To: "Access Developers discussion and problem solving" 
>> <accessd at databaseadvisors.com>
>> Sent: Saturday, March 05, 2005 5:11 PM
>> Subject: Re: [AccessD] Contralling a second mdb from the first mdb
>>
>>
>>> Marty:
>>>
>>> So far the code is:
>>>
>>>    DoCmd.RunSQL "DELETE from C:\Acessdat\Reports.tUDGlobalMerge"
>>>    DoCmd.RunSQL "INSERT INTO tUDGlobalMerge " & _
>>>                 "IN 'C:\ACESSDAT\Reports.mdb' " & _
>>>                 "SELECT tUDGlobalMerge.* " & _
>>>                 "FROM tUDGlobalMerge"
>>>
>>>
>>> This code is run from a database named Forms.mdb
>>> It deletes all the records in a table tUDGlobalMerge in the database 
>>> named Reports.
>>>
>>> It then copies all the data from the table named tUDGlobalMerge in 
>>> Forms.mdb to the table tUDGlobalMerge in Reports.mdb.  Where it can then 
>>> be run.
>>>
>>> What client wants now is, from the database Forms.mdb, open Reports.mdb 
>>> hidden (so it doesn't show in the screen), print Report and close 
>>> Reports.mdb.
>>>
>>> Can it be done with DoCmd.OpenReport specifying the report as the 
>>> database and report name in the reports collection?
>>>
>>> TIA
>>>
>>> Rocky Smolin
>>> Beach Access Software
>>> http://www.e-z-mrp.com
>>> 858-259-4334
>>>
>>>
>>> ----- Original Message ----- From: "MartyConnelly" 
>>> <martyconnelly at shaw.ca>
>>> To: "Access Developers discussion and problem solving" 
>>> <accessd at databaseadvisors.com>
>>> Sent: Saturday, March 05, 2005 2:17 PM
>>> Subject: Re: [AccessD] Contralling a second mdb from the first mdb
>>>
>>>
>>>> I know of two ways but this depends on program flow, you are running 
>>>> from one or the other mdb
>>>> 1. Use an MDA but I don't know all the ramifications of using an MDA, 
>>>> there are exceptions like circular references
>>>>  See MDH Developers Handbook on Developing wizards
>>>>  or
>>>> http://www.vb123.com/toolshed/00_Docs/buildwizards.htm
>>>>
>>>> 2. TSI SOON from Michael Kaplan (Shut One, Open New)  requires a DLL 
>>>> and VB6 runtime
>>>>
>>>> Rocky Smolin - Beach Access Software wrote:
>>>>
>>>>> Dear List:
>>>>>
>>>>> Can you control all of the functions of a second mdb from the first 
>>>>> mdb - start, open forms, run reports, etc.?
>>>>>
>>>>> TIA
>>>>>
>>>>> Rocky Smolin
>>>>> Beach Access Software
>>>>> http://www.e-z-mrp.com
>>>>> 858-259-4334
>>>>>
>>>>
>>>> -- 
>>>> Marty Connelly
>>>> Victoria, B.C.
>>>> Canada
>>>>
>>>>
>>>>
>>>> -- 
>>>> AccessD mailing list
>>>> AccessD at databaseadvisors.com
>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>> Website: http://www.databaseadvisors.com
>>>>
>>>
>>> -- 
>>> AccessD mailing list
>>> AccessD at databaseadvisors.com
>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>> Website: http://www.databaseadvisors.com
>>>
>>
>
> -- 
> Marty Connelly
> Victoria, B.C.
> Canada
>
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list