I need to export all of the objects from my MDB to text files in a folder, and them import those text files as fresh Access objects into a brand new MDB, using some VBA code.
Does anyone have the source code for this? I know it exists out there somewhere, I just can't find it at the moment.
In the Access Navigation Pane, right-click the source object, point to Export, and then click Text File. You can also launch the Export - Text File wizard by highlighting the source object in the Navigation Pane and then on the External Data tab, in the Export group, click Text File.
To export data from Access, first select the table or other database object to export in the Navigation Pane. Next, click the “External Data” tab in the Ribbon. In the “Export” button group, then click the button for the file format to which to export the selected object.
In importing data, we bring data from other formats in Access, while in exporting we save the data in other formats. To understand what kind of data you can export from Access data, let us open your database and go to the External Data tab.
Corrupt Objects within a Corrupt Microsoft Access MDB
The little documented SaveAsText
and LoadFromText
may help if an object is corrupted or otherwise behaving weirdly.
At the debug/immediate window type:
Application.SaveAsText acForm,"MyForm","c:\form.txt"
You can load the file into a new MDB.
Application.LoadFromText acForm,"MyForm","c:\from.txt"
Sample code at http://www.datastrat.com/Code/DocDatabase.txt for saving all objects in an MDB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With