473,903 Members | 4,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1632
Have you considered running, from a Standard Module
SaveAsText acForm, "FormName" , "OriginalTextFi leName.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" , "OriginalTextFi leName.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" , "OriginalTextFi leName.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" , "OriginalTextFi leName.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
8186
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 that the apostrophe is automatically replace with two '' . Reason being--SQL Server does not like apostrophes being sent to database. I've tried to do this on the server side in the SQL area of the ASP page by writing a function (with some great...
2
10657
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 table: Transactions SID Schedule ...
3
3792
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 Replace function in a couple of queries to reformat some data. The application works flawlessly on 8 of the workstations, but on the other 4 throws a "Unrecognized function Replace" error when the queries in question are encountered. I have...
14
10159
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 I should give back to the community by posting our findings. Thanks you all for all your help till now by posting problems and their solutions. ~Abhijit
7
1610
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 that function, and replace the current function's info with new function info? Example of what I need... (1) Open the "frmClients" form in design view. (I can do already). (2) Find the code behind the OnClick property of btnPrintHistory.
19
78870
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 find one.
3
2413
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 built in a class library that had multithreading enabled.
12
4539
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 code and this then fills details on 2 list boxs for course module code and description. The course section can then be selected from another combo box (filtered by the value in the first combo box) . Finally the course session name is entered...
2
6914
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 "RecordSource" of the given form. For example, if my string variable is called "PriKeyFields", and the primary key of the RecordSource table is (Field01, Field02, Field03), then I would like PriKeyFields to be set to the string "Field01 Field02 Field03"....
0
9847
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11283
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10875
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10986
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9685
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8049
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5894
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6093
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4727
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.