473,413 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How Do I Replace the Primary Code Module for a Form?

I do a lot of my code writing for Access forms at home, where I have
no access to Access.

While in Access, I export the entire primary code module,
xxx.cls where xxx begins "Frm_" and includes the form name as
a text file. Then I make extensive changes to this text file at home:
I would like to import the new version as a replacement for the old,
but I'm afraid to try it since I haven't figured out the exact way to
do this.

I haven't been able to figure out how to get google to tell me either,
so can someone here please help?

thanks, --thelma
May 26 '06 #1
2 1596
Have you considered running, from a Standard Module
SaveAsText acForm, "FormName" , "OriginalTextFileName.Ext"
to get your editable text file. This will include all the code plus the
definitions of all the form's objects and their properties, which may
be helpful. You can take this text file home, make a copy and do your
editing in the copy. Then you can take both the files back to wherever
and

modify the original form with
LoadFromText acForm. "FormName" , "EditedTextFile.Ext"

You will of course have the original text file (you edited a copy, I
hope!) to recover from errors with
LoadFromText acForm. "FormName" , "OriginalTextFileName.Ext".
but if the errors seem minor you can simply re-edit your working copy.

After you are happy with your changes you can start an archive of
changes you have made in text form by saving the original and edited
text files with unique names.

LoadFromText is a 100% unforgiving command. It overwrites the original
form (assuming it exists) without any warning whatever. If you don't
preserve backup copies of code and forms the previous manifestations
are gone forever.

But the commands are extremely simple and powerful.

Using one of the saved text files as a template you could even create
an entirely new form at home without Access. I don't know of anyone who
does this, so why not you to be a pioneer?

Did I mention that you lose EVERYTHING if you are not careful to make
backup copies?

May 26 '06 #2
Lyle Fairfield <ly***********@aim.com> wrote:
: Have you considered running, from a Standard Module
: SaveAsText acForm, "FormName" , "OriginalTextFileName.Ext"
: to get your editable text file. This will include all the code plus the
: definitions of all the form's objects and their properties, which may
: be helpful. You can take this text file home, make a copy and do your
: editing in the copy. Then you can take both the files back to wherever
: and

: modify the original form with
: LoadFromText acForm. "FormName" , "EditedTextFile.Ext"

: You will of course have the original text file (you edited a copy, I
: hope!) to recover from errors with
: LoadFromText acForm. "FormName" , "OriginalTextFileName.Ext".
: but if the errors seem minor you can simply re-edit your working copy.

: After you are happy with your changes you can start an archive of
: changes you have made in text form by saving the original and edited
: text files with unique names.

: LoadFromText is a 100% unforgiving command. It overwrites the original
: form (assuming it exists) without any warning whatever. If you don't
: preserve backup copies of code and forms the previous manifestations
: are gone forever.

: But the commands are extremely simple and powerful.

: Using one of the saved text files as a template you could even create
: an entirely new form at home without Access. I don't know of anyone who
: does this, so why not you to be a pioneer?

: Did I mention that you lose EVERYTHING if you are not careful to make
: backup copies?

Thank you. I will try this.

So far I've always remembered to make a backup of the entire
.mdb file before I begin to make any changes. My worst losses
have happened on days where I've made extensive changes in a
single session, forgetting to save when something actually
works, and then losing the entire session's work by making a
change that causes Access to give up with no option for
saving what's already been done.

Actually, I'll try this on a copy of the entire .mdb -- I'm
working with relatively small .mdb's so that's not a problem.
And I do tend to use a 'template' mindset in going from one
project to another, so I probably will use your suggestion
in creating some future form.

--thelma

May 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
2
by: suzanne shelton | last post by:
Help! I have two tables that i am wishing to join that involve a multiple field primary key on the primary table. Primary table: ScheduleHistory SID *PK Schedule *PK Secondary...
3
by: Dave | last post by:
I have an Access 2K application that is distributed to about a dozen users (all with identical NT environments and identical Access versions, object libraries and service packs). I am using the VBA...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
7
by: Access2003Guru | last post by:
Instead of sending an entire form to a client that includes code changes, I'm trying to update just one section of code. If I know the object, function name & property, is there a way to search...
19
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not...
3
by: Chua Wen Ching | last post by:
Hi there, I just read Chris Sells's article at http://www.codeproject.com/csharp/delegate_bedtime.asp?df=100&forumid=2983&select=922269#xx922269xx I wonder i can do this: 1) I want to...
12
by: Aidan | last post by:
I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key. The first combo box on the form allows selection of the course POP...
2
by: Tom_F | last post by:
To comp.databases.ms-access: In the VBA code behind a form, I would like to create a string variable, composed of the names of the field(s) in the primary key of the table which is the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.