[AccessD] My latest bright idea

John Colby jwcolby at gmail.com
Sat Jan 29 06:29:25 CST 2022

I haven't tried it yet but...

I want to publish my class stuff as an ebook a la Rocky.  The problem is
creating an example database that I can update for eratta or fixes.  The
code below supposedly saves and loads forms and modules.  What I do not
know yet is whether it actually saves the form itself complete with all the
controls, their positions etc.  If so then...

Imagine a power shell script which the book buyer runs.  The script
downloads a small, mostly empty database from my github page and opens it.
When it opens an autoexec fires, which runs code in the one little module
in the mostly empty database.  The code loads a little switchboard form
with chapter buttons contained in a text file stored on my github page.
The click of each button loads any modules, classes and forms required for
a chapter from text files stored on my github page, essentially
bootstrapping a fully functional demo database from text files stored on my
github page.  If any of these files need changing or updating, I update
them and load them back to my github page.  The next time the user opens
the database, the changes are now loaded in the little database.

If this works, I could build a maintainable demo database sitting in GitHub.

The user can use the switchboard to load demo modules, classes, forms and
reports, and then open forms which demo the functioning classes and how
they work.

In the old days (I know them well) a publisher would build a CD which would
be contained in an envelope in the back of the book.  The method I am
discussing would replace that CD.

Questions, comments or things I forgot or didn't think about?

*The code I referenced above...*

The little documented SaveAsText and LoadFromText may help if an object is
corrupted or otherwise behaving weirdly.  *Or for my purposes above...*

At the debug/immediate window type:

Application.SaveAsText acForm,"MyForm","c:\form.txt"

You can load the file into a new MDB.

Application.LoadFromText acForm,"MyForm","c:\from.txt"

John W. Colby
Colby Consulting

More information about the AccessD mailing list