[AccessD] Where to place path constants?

Arthur Fuller fuller.artful at gmail.com
Sun Mar 6 11:24:13 CST 2022


Thanks, Gustav and Ryan. I'll toy with both approaches and see the results.
I checked CurrentProject.Path and see that it also returns the drive
letter. So from that I could build the names of its subdirs to tell the app
where to look for Document Templates, where to save Reports, and so on.
One more question, not directly related. Suppose that I wanted to place all
the Constants in a single file. Does the compiler figure it out
automatically? Or do I have to tell it to load the Constants file before
anything else? And if so, how?

On Sun, Mar 6, 2022 at 10:46 AM Ryan W <wrwehler at gmail.com> wrote:

> I like to place them in a setup table and then look them up into a global
> variable or tempvar on startup. That way if you need to change the path you
> change it in the DB and don’t have to change a constant in code and
> redistribute a new FE.
>
>
>
> Sent from my iPhone
>
> > On Mar 6, 2022, at 9:34 AM, Gustav Brock via AccessD <
> accessd at databaseadvisors.com> wrote:
> >
> > Hi Arthur
> >
> > Perhaps: CurrentProject.Path
> >
> > /gustav
> >
> > Fra: Arthur Fuller<mailto:fuller.artful at gmail.com>
> > Sendt: 6. marts 2022 14:08
> > Til: Access Developers discussion and problem solving<mailto:
> accessd at databaseadvisors.com>
> > Emne: [AccessD] Where to place path constants?
> >
> > I'm revising an app that assumes some paths based on the drive letter and
> > the project path. At the moment, it uses constants that are scattered
> > throughout the app. I want to move them all into a single module,
> > tentatively called modPathConstants, to minimize the find and replace
> > hassles. Actually, the only thing that will change is the drive letter.
> The
> > directory and subdirectory names will remain the same.
> > I vaguely recall a function called ProjectPath() or somesuch. Guidance
> > requested.
> >
> > --
> > 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