Whoever can figure this out...

G

Guest

Hi everyone!

I am creating the following sample form called "Apples."

File Name = Iloveapples
apple 1 = excellent
apple 2 = good
apple 3 = bad

There are multiple records to this form.

QUESTION: Am I able to export a TEXT file PER record in Access 2003??

I have the code below in my code for my command button called "ReporttoFile"
and am able to generate separate text files for EACH record. However, the
content in the text files come in the XML format which is not very readable.
This is because in my code it says "Application.ExportXML."

Here's my code:

Private Sub ReporttoFile_Click()
Dim rsR As DAO.Recordset

Set rsR = CurrentDb.OpenRecordset("3D PDF Metadata", dbOpenSnapshot)

Do Until rsR.EOF
Application.ExportXML acExportForm, "Apples", _
"C:\Temp\Metadata\" & rsR.Fields("Apple Name =").Value & ".txt", , , ,
, , _
"[Apple Name =] = '" & rsR.Fields("Apple Name =").Value & "'"
rsR.MoveNext
Loop

End Sub



This is how my text file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:blush:d="urn:schemas-microsoft-com:blush:fficedata"
generated="2007-10-04T13:37:29">
<_Apples>
<File_x0020_Name_x0020__x003D_>Iloveapples</File_x0020_Name_x0020__x003D_>
<apple1_x0020__x003D_>excellent</apple1_x0020__x003D_>
<apple2_x0020__x003D_>good</apple2_x0020__x003D_>
<apple3_x0020__x003D_>bad</apple3_x0020__x003D_>


and so forth...


QUESTION2: How can I get rid of the XML format, specifically the
"x0020_x003D" and transform it into text??


I would greatly appreciate any advice on this!

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top