Using dynamic linking is an important method.
set obj = CreateObject("Access.Application")
v = loadlib("fred.dll")
Even in everyday use of my computer, sometimes I use
Word, and sometimes I use Notepad.
Sometimes it is desirable to dynamically link code inside your
own program. In an 'object oriented' design, you do this by
inheriting or over-riding methods. In a 'procedural' design, you
do this by using procedural variables. In a '1st Generation' design,
you do this by overwriting the procedural code. In a 'runtime'
or 'managed' design you do this by providing the name of the
function you wish to run to the object manager.
(david)
"Klatuu" <(E-Mail Removed)> wrote in message
news:0D799CEB-3076-4C29-BE8A-(E-Mail Removed)...
> Whatever for?
> The form name can be captured using a variable:
>
> strFrmName = Forms!frmSomeForm.Name
>
> But now it is a string variable, not an object and can't be referred to as
a
> object.
>
> I don't know that you can get the functions collection for an mdb. There
is
> an allfunctions property, but it applies only to SQL databases.
>
> In any case, using variables to refer to functions makes absolutely no
> sense. It would only make your code harder to read.
>
> I would recommend you abandon the whole idea.
>
>
> "Andrew Tapp" wrote:
>
> > Has anyone found a way of dynamically calling a controls, say after
update
> > event.
> >
> > Hard coded i would normally use:
> >
> > ProjectName.Form_frmForm.txtControlName_AfterUpdate
> >
> > I am after a way of replacing the form name and control event with
variables.
> >
> > Any help would be appreciated.
|