Originally Posted by
ranman256
in access, you dont SaveToText .
you EXPORT data to text from a table or query.
SaveToText is an undocumented feature that is most often used to by source code control systems.
I wrote this short article about the feature: Backing up and Restoring Objects
Originally Posted by
memaxt
Hi there,
I'm looking to save each objects design code using the application.savetotext, but rather than saving to separate text files I would like to save it to a table.
@memaxt,
Curious, Are you working on your own version of Source Code Control?
There is not a built-in method to automatically store the output of the SaveToText into a table. The good news it that will be very easy to write your own code to do it.
The Basic language, pre windows days, had built-in command to handle reading and writing to text files. They still exist in VBA today. I have been using them since the mid 1980's.
The following example from the help should get you started.
Line Input # Statement Example
This example uses the Line Input # statement to read a line from a sequential file and assign it to a variable. This example assumes that TESTFILE is a text file with a few lines of sample data.
Code:
Dim TextLine
Open "TESTFILE" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, TextLine ' Read line into variable.
Debug.Print TextLine ' Print to the Immediate window.
Loop
Close #1 ' Close file.
When I export a frontend I wire each of the objects in a folder by type. For example all the forms are in a sub folder named forms. I have not had the need to do it for these files, but it would be easy to write code to read the folder and load all the files into a table.