Solved

Exporting Access Forms as .frm files

Posted on 2007-12-03
7
1,453 Views
Last Modified: 2013-11-27
I do not know how to save an existing form in Access as a ".frm" file that another Access application can import wholesale.  When I right click on an existing form in the Project Explorer, the option of saving to a ".frm" file is not available to me, only ".cls".  The ".cls" file, however, will not import as a form, but as a class module.  I am, at this point, stymied.

With Excel, the process is simple and seamless.  Create a form, export to a ".frm" file, and re-import that file into another VB project: Do Access forms have the same capability?  Any support you can provide is most appreciated.
0
Comment
Question by:PeterFrb
7 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 20401188
With Access you can import & export to & from databases, but I'm not aware of any functionality to save them as a file.

With a form open you can go to File Export & export the form to another selected database.

You can also choose File> Get External Data and Import a form from another database.


Kelvin
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 20401577
As Kelvin said this functionality is not generally required because you can just import the object directly from the source mdb, or even copy and paste.
However, there are commands which save and load the form.

application.saveastext acForm,"myform","c:\folder\anyname.txt"
and
application.loadfromtext acForm,"formname", "c:\folder\anyname.txt"
0
 

Author Comment

by:PeterFrb
ID: 20413872
Thank you for your feedback, and I'm sorry that work has kept me from responding sooner.

Oddly, saveastext and loadfromtext do not seem to be part of the Access Application object.  I can run them from within Access as direct methods, but these do not show up on the list of Access Appliation methods.  As I am manipulating a code in a file external to the running Access file, I need to be able to have these methods available in order for me to be able to run them remotely,  

I think I have to change a setting somewhere in order to make these methods available to the Access application object.  Please keep at it.  Peter57r is definitely on the right track.
 
Thank you, Peter Ferber
0
 
LVL 77

Expert Comment

by:peter57r
ID: 20416056
SaveAsText and LoadFromText are 'undocumented' commands- well until fairly recently- but have been somewhat widely known for a few years.
They do not appear on Intellisense within Access but if you type the command you then get in-line help with the arguments as you type.
0
 

Expert Comment

by:fakeleft
ID: 21388221
Being able to export forms to .frm, like in Excel, would be useful for keeping track of the modules inside a VCS like Subversion.  Does anyone do this?
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question