[AccessD] Call a function in an AccDb from outside it?

Arthur Fuller fuller.artful at gmail.com
Fri Oct 14 09:58:01 CDT 2022


Thanks, Rocky. I'll give that a try and see how seamless it is.

On Fri, Oct 14, 2022 at 10:13 AM Rocky Smolin <rockysmolin2 at gmail.com>
wrote:

> Here is a workaround, somewhat awkward but it could work. Create a module
> to do what you want to do where the data that you want ends up in a table
> That you create. Then push that module into the external database, trigger
> it from your app. When it’s done extracting the form data and putting it
> into the local table, have the app transfer that table to your database.
> Then, clean up after the module by deleting it and the table from the
> external database.
>
> Not elegant, but it would be fun to program it. 😛
>
> r
>
> On Fri, Oct 14, 2022 at 11:53 AM Arthur Fuller <fuller.artful at gmail.com>
> wrote:
>
> > Rocky,
> > First, count them. Second, list their important properties.  Third, list
> > their controls and some of the controls' important properties. Sort of
> like
> > an extended data dictionary.
> >
> > On Fri, Oct 14, 2022 at 2:17 AM Rocky Smolin <rockysmolin2 at gmail.com>
> > wrote:
> >
> > > Arthur:
> > >
> > > If you couLd access the forms in the other db, what would you do with
> > them?
> > >
> > > R
> > > On Fri, Oct 14, 2022 at 12:04 AM Stuart McLachlan <
> > stuart at lexacorp.com.pg>
> > > wrote:
> > >
> > > > Don't know if it's any use to you,
> > > > but here's something that may get you started on your desired path.
> > > > It lets you open a second database and manipulate it:
> > > >
> > > > Function OpenForm(DB As String, frm As String) As Long
> > > >  Dim strDB As String
> > > >  strDB = CurrentProject.Path & "\" & DB
> > > >  Dim appSecondInstance As New Access.Application
> > > >  With appSecondInstance
> > > >     .Visible = True
> > > >     .UserControl = True
> > > >     .OpenCurrentDatabase strDB
> > > >     .DoCmd.OpenForm frm, acNormal
> > > >  End With
> > > > End Function
> > > >
> > > >
> > > >
> > > > On 14 Oct 2022 at 7:50, Stuart McLachlan wrote:
> > > >
> > > > > About the only way I can think of would be to iterate through
> > > > > msysObjects, that will at least give you the names of all the
> > > > > forms,reports and modules.
> > > > >
> > > > > A lot depends on what you mean by "process its forms".
> > > > > "Processing" them would be a very different matter since they are
> > > > > actually different objects embedded in the accdb  not a part of the
> > > > > data engine - you can't access them through DAO's OpenDatabase.
> > > > >
> > > > > An Access .accdb is essentially two sepearate pieces:
> > > > > 1. A  relational database management system (tables and queries)
> > > > > 2. An application consisting of various types of objects (windows
> > > > > forms, reports, controls, and compiled code) which connect to the
> > > > > RDBMS.
> > > > >
> > > > >
> > > > > On 13 Oct 2022 at 17:00, Arthur Fuller wrote:
> > > > >
> > > > > > I'm still working on my problem of opening an AccDb within a
> > running
> > > > > > one. Thanks to Stuart, I now have that part working beautifully.
> > But
> > > > > > as they say, inside every beautiful solution lurks a monster
> ready
> > > > > > to bite you.
> > > > > >
> > > > > > So I've got my utility able to browse for a database to open,
> then
> > > > > > list its TableDefs and QueryDefs. I want to move on to be able to
> > > > > > process its forms, but I can't get at AllForms. Is there any way
> to
> > > > > > do this?
> > > > > >
> > > > > > Failing that, I thought that maybe I could write a function
> inside
> > > > > > the "target" db (the one opened within my utility) and maybe call
> > it
> > > > > > from the utility DB? Is that possible?
> > > > > >
> > > > > > --
> > > > > > Arthur
> > > > > > --
> > > > > > AccessD mailing list
> > > > > > AccessD at databaseadvisors.com
> > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > Website: http://www.databaseadvisors.com
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > >
> > > >
> > > >
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> >
> >
> > --
> > Arthur
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
Arthur


More information about the AccessD mailing list