Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Code to Text File

Status
Not open for further replies.

Mitchy

Technical User
Jun 19, 2002
59
0
0
US
I have a problem with an Access 2000 database. I am getting a "Error accessing file. Network connection may have been lost error" message.

One fix involves saving the code for the forms and reports as a text file and rebuilding the database.

I am not sure exactly how to save the code as a text file. Can someone provide some guideance?

Thanks,
 
In the project browser window (Ctrl+R) right click the module name and choose the export option.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried to export the code file and it saved as a .cls file in my documents. I am assuming that this was what I needed to do.

How do I restore the code back into a new database?

Thanks again,

 
With the Import option of the File menu.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The following steps are required to try and fix my problem. When I tried to save the code as a text file, it would only save as a .cls file. I change the hasmodule to false and then save but the object reverts to the original true value. I am just stuck. Can anyone help out?

1. Open a form or a report in Design view.
2. Save the code behind the form or the report as a text file.
3. Set the form or the HasModule property of the report to No, and then save the object.
4. Repeat step 1 through step 3 for each form and report in the database.
5. Save each module as a text file.
6. Create a new blank database.
7. On the File menu, point to Get External Data, and then click Import. Import all tables, queries, forms, reports, data access pages, and macros to the new database.
8. Restore the code behind each form and each report from the text files that you created in step 1 through step 4.
9. Import each text file that you saved in step 5 as a new module.
 
What happens if you change the hasmodule to false, delete the corresponding class module and then save ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I am not extactly sure what you mean when you say delete the class module.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top