By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,439 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,439 IT Pros & Developers. It's quick & easy.

import form code

P: n/a
I have made a number of changes to the code of an access 2000
application, and now the person responsible for the application wants
to import one change at a time into his "master copy", after he has
understood the change.

Most of the code in this application is in the forms. I find that I can
export the code, and I can import the code of the modules, but I cannot
import the code of the forms. I have exported the code of the forms to
one file per form, and I use Unix utilities to find the differences
between his master version and my version.

One logical change can affect the code of many forms, e.g., if a global
variable name is introduced instead of a string litteral repeated
everywhere. To do everything completely by hand implies a high risk of
comitting some error.

I can use Unix utilities to selectively patch a copy of the master
version with chosen changes. That means I can relatively easy create
patch files each containing one logical change, and apply one such
patch to the set of files that will become the next version of the
master, with a single command.

The only problem that stops the show is that I cannot easily import the
modified source code into the forms of the Access application. It seams
that I have to open each form one at the time, delete all the code, and
paste in the new version of the code from some editor. There are more
than forty forms, so that means opening forty files in the editor,
opening the corresponding form in the Access Basic editor, etc. This
only to import one logical change. Then test, etc. There is no way I
can have the attention of the responsible person for so long time.

I am not very expert in ms-access, but I guess that if I can
copy-and-paste the code of a form, it is perhaps a way to do the same
through a macro or some other basic code. I could add a special-purpose
form with a button to import all the code files in a specified

But what macros or basic commands can I use? Any tips?

Regards, Enrique Perez-Terron

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
The (semi-)Undocumented SaveAsText and LoadFromText is one way to do
this, though you'll have to pass over all the lines that declare and
format the form itself as well as the controls on the form.

I think you can also get at it by going through the documents
collection, but I can't seem to be able to find an example of that at
the moment to confirm it. I know I've done this before, but my memory
appears to be failing on this.... (Getting old sucks!)

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.