Exported delimited text file group together by unique values in header and details from Access 2007

I have problem with my text file that was populated from Access. I have been trying to look for any solution but to no avail.
Please find attached text files:
APInvoice_MyCode.del = this is the code I have for now that populates from the table into text file. It shows Header and detail each time with the same Invoice No and FullGLAccountNo.
APInvoices_What_I_Want_Is_Group.del = this is what I want to accomplish. Group by same Invoice No and FullGLAccountNo.

What I want is to group the same InvoiceNo, FullGLAccountNo together.
This is the VBA code I have so far:
Dim strpath As String
Dim sfilter As String
Dim sfile As String
Dim lsCurPath As String
Dim rs As New ADODB.Recordset
Dim rsWrk As New ADODB.RecordsetDim rsHeader As New ADODB.Recordset
Dim rsDetail As New ADODB.Recordset
Dim TempBatch As String
Dim tempdate As String
Dim tempExtension As String
Dim lsUserID As String
Dim lsCommentVal As String
Dim lsCurrComment As String
Dim lsTempComment As String
Dim defaultIfNull As String
Dim lsCurCompanyID As String
Dim tranType As String
Dim detailType As String
Dim headerType As String
Dim useTaxType As String
Dim S As String
Dim tempInvoice As String
Dim lsquantity As String
Dim taxString As String
Dim vBatch As Date

  
    
    lsUserID = "admin"
    lsCommentVal = "0"
    lsTempComment = "Import-Invoice No:"
    defaultIfNull = "1"
    lsCurCompanyID = "Canton"
    taxString = "000 NOT TAXABLE"
    tranType = "401"
    detailType = "D"
    headerType = "V"
    useTaxType = "X"
    lsquantity = "1"
    S = ";"
    sfile = "APInvoices_"

    
 
            
    strsql = "Select ID,VendorID, InvoiceNo, InvoiceTotal, InvoiceDate, InvoiceDueDate, FullGLAcctNo, Comment from tblMainAPImport ORDER BY InvoiceNo"
    rsWrk.Open strsql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
 

    If Len(strpath) <= 0 Then
        strpath = "\\network\project\development\"
    End If
    
    sfilter = "del" & Chr(0) & "*.*" & Chr(0)
    
    'open browse file box for input file
    lsCurPath = ahtCommonFileOpenSave(, strpath, sfilter, , , sfile, "Choose a Location for AP Invoice Export...", , False)
     
   
     If lsCurPath = "" Then
        MsgBox "The Export Invoices operation was canceled.", , " "
        GoTo Cancel_cmdExportExcel_Click
    End If
    
    'set filename of export file
    lsCurPath = lsCurPath & ".del"
        
    'open text file
    Open lsCurPath For Output As #1
    
Do Until rsWrk.EOF
        'open header and write to .del file
        rsHeader.Open "Select D.VendorID,D.InvoiceNo,D.InvoiceTotal,D.InvoiceDate,D.InvoiceDueDate,D.FullGLAcctNo,D.Comment" _
            & " from tblMainAPImport D" _
            & " where D.ID = " & rsWrk!ID, CurrentProject.Connection, adOpenDynamic, adLockPessimistic
        lsCurrComment = lsTempComment & Trim(rsHeader!InvoiceNo)
        
        If rsHeader.Fields("InvoiceTotal") < 0 Then
            tranType = "402"
        Else
            tranType = "401"
        End If
        
        'write to text file in MAS import format
        
        Print #1, headerType; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!InvoiceDate); S; Trim(rsHeader!InvoiceNo); S; tranType; S; S; defaultIfNull; S; lsUserID; S; S; S; S; S; S; Format(rsHeader!InvoiceDueDate, "mm/dd/yyyy"); S; S; S; S; S; S; S; S
        
        Print #1, detailType; S; S; lsCommentVal; S; S; Trim(rsHeader!InvoiceTotal); S; S; S; Trim(lsCurrComment); S; S; S; lsquantity; S; S; Trim(rsHeader!FullGLAcctNo); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; taxString; S; S; S; S; S; S; S; S; S; S
        
       rsHeader.Close
        rsWrk.MoveNext
        
    Loop
    Close #1
    rsWrk.MoveFirst
    rsWrk.Close
    
MsgBox "The AP Invoice has been created.", vbOKOnly, "Export Complete!"
        
    Set rsWrk = Nothing
    Set rsDetail = Nothing
    Set rsHeader = Nothing

Exit_cmdExportExcel_Click:
    Close #1
    Exit Sub
Cancel_cmdExportExcel_Click:
         GoTo Exit_cmdExportExcel_Click
End Sub

Open in new window

Please help.
Queennie LAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Queennie LAuthor Commented:
This is my table in access.
Table.docx
0
tomfarrarCommented:
If I understand what you are looking for (unless the grouping must occur in the text document) could perhaps be resolved by opening the text document in Excel, use text-to-column to parse the data into separate columns (if it doesn't already do that for you), and create a pivot table that groups by invoiceNO and FullGLAcctNo.  If you don't want to leave it as a pivot table, you could then copy pivot table and paste "value".
0
Queennie LAuthor Commented:
The grouping must occur in the text document.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Queennie LAuthor Commented:
I've requested that this question be deleted for the following reason:

Edited this question.
0
Queennie LAuthor Commented:
0
Queennie LAuthor Commented:
I've requested that this question be deleted for the following reason:

Nobody responded.
0
Queennie LAuthor Commented:
Yes.
0
mlmccCommented:
I think what you need to do is loop through the detail records until the ID changes

        'write to text file in MAS import format
        
        Print #1, headerType; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!InvoiceDate); S; Trim(rsHeader!InvoiceNo); S; tranType; S; S; defaultIfNull; S; lsUserID; S; S; S; S; S; S; Format(rsHeader!InvoiceDueDate, "mm/dd/yyyy"); S; S; S; S; S; S; S; S
        
    Do Until rsHeader!ID   <>  rsWrk!ID
        Print #1, detailType; S; S; lsCommentVal; S; S; Trim(rsHeader!InvoiceTotal); S; S; S; Trim(lsCurrComment); S; S; S; lsquantity; S; S; Trim(rsHeader!FullGLAcctNo); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; taxString; S; S; S; S; S; S; S; S; S; S
                rsWrk.MoveNext
   Loop
       rsHeader.Close

Open in new window


mlmcc
0
mlmccCommented:
Have you tried my solution?

mlmcc
0
Queennie LAuthor Commented:
@mlmcc:

I tried it but still the same. See attach text file.

If VendorID and InvoiceNo are the same in Header then show only the Header once. It can be multiple details based on the VendorID and InvoiceNo.

I have been trying to work on this for few days.

Thank you for your help.
APInvoices-6.txt
0
aikimarkCommented:
Please test this.  In this version of your routine, I'm opening up a Group By recordset of the header data.  For each header record, I'm retrieving the detail records for that invoiceNo.

Since your invoiceTotal varies with each detail row, I'm summing the TotalInvoice data for use in the loop.  This value determines the trantype.
Dim strpath As String
Dim sfilter As String
Dim sfile As String
Dim lsCurPath As String
Dim rs As New ADODB.Recordset
Dim rsWrk As New ADODB.RecordsetDim rsHeader As New ADODB.Recordset
Dim rsDetail As New ADODB.Recordset
Dim TempBatch As String
Dim tempdate As String
Dim tempExtension As String
Dim lsUserID As String
Dim lsCommentVal As String
Dim lsCurrComment As String
Dim lsTempComment As String
Dim defaultIfNull As String
Dim lsCurCompanyID As String
Dim tranType As String
Dim detailType As String
Dim headerType As String
Dim useTaxType As String
Dim S As String
Dim tempInvoice As String
Dim lsquantity As String
Dim taxString As String
Dim vBatch As Date

  
    
    lsUserID = "admin"
    lsCommentVal = "0"
    lsTempComment = "Import-Invoice No:"
    defaultIfNull = "1"
    lsCurCompanyID = "Canton"
    taxString = "000 NOT TAXABLE"
    tranType = "401"
    detailType = "D"
    headerType = "V"
    useTaxType = "X"
    lsquantity = "1"
    S = ";"
    sfile = "APInvoices_"

    
 
            
 

    If Len(strpath) <= 0 Then
        strpath = "\\network\project\development\"
    End If
    
    sfilter = "del" & Chr(0) & "*.*" & Chr(0)
    
    'open browse file box for input file
    lsCurPath = ahtCommonFileOpenSave(, strpath, sfilter, , , sfile, "Choose a Location for AP Invoice Export...", , False)
     
   
     If lsCurPath = "" Then
        MsgBox "The Export Invoices operation was canceled.", , " "
        GoTo Cancel_cmdExportExcel_Click
    End If
    
    'set filename of export file
    lsCurPath = lsCurPath & ".del"
        
    'open text file
    Open lsCurPath For Output As #1
    'open header and write to .del file
    rsHeader.Open "Select VendorID, InvoiceNo, InvoiceDate, InvoiceDueDate, Sum(InvoiceTotal) As SumOfInvoiceTotal" _
        & " from tblMainAPImport D " _
        & " Group By VendorID, InvoiceNo, InvoiceDate, InvoiceDueDate" _
        & , CurrentProject.Connection, adOpenDynamic, adLockPessimistic
    
    Do Until rsHeader.EOF
        If rsHeader!SumOfInvoiceTotal < 0 Then
            tranType = "402"
        Else
            tranType = "401"
        End If

        Print #1, headerType; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!InvoiceDate); S; Trim(rsHeader!InvoiceNo); S; tranType; S; S; defaultIfNull; S; lsUserID; S; S; S; S; S; S; Format(rsHeader!InvoiceDueDate, "mm/dd/yyyy"); S; S; S; S; S; S; S; S
        
        strsql = "Select ID,VendorID, InvoiceNo, InvoiceTotal, InvoiceDate, InvoiceDueDate, FullGLAcctNo, Comment from tblMainAPImport Where InvoiceNo=" & rsHeader!InvoiceNO & " ORDER BY InvoiceNo"
        rsWrk.Open strsql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
        
        Do Until rsWrk.EOF
            'write to text file in MAS import format
            Print #1, detailType; S; S; lsCommentVal; S; S; Trim(rsHeader!InvoiceTotal); S; S; S; Trim(lsTempComment & Trim(rsWrk!InvoiceNo)); S; S; S; lsquantity; S; S; Trim(rsHeader!FullGLAcctNo); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; taxString; S; S; S; S; S; S; S; S; S; S
        
            rsWrk.MoveNext
        Loop
        
        rsHeader.MoveNext
    Loop
    
    Close #1
    rsHeader.Close
    rsWrk.MoveFirst
    rsWrk.Close
    
MsgBox "The AP Invoice has been created.", vbOKOnly, "Export Complete!"
        
    Set rsWrk = Nothing
    Set rsDetail = Nothing
    Set rsHeader = Nothing

Exit_cmdExportExcel_Click:
    Close #1
    Exit Sub
Cancel_cmdExportExcel_Click:
         GoTo Exit_cmdExportExcel_Click
End Sub

Open in new window

Note: you might need to tweak the code in order accommodate these changes.  This code is not tested.
0
Queennie LAuthor Commented:
@aikimark:

There is an error message when I run this code:

Run-time error '3709':
The connection cannot be used to perform this operation. It is either closed or invalid in this context.

Thank you.
0
aikimarkCommented:
what line does it stop on?
0
aikimarkCommented:
My instinct would be that it is on the rsWrk.Open statement.  If so, we need to close the recordset every time we go to the next header row.  If so, the bottom of the outer loop will need to look like this:
        rsHeader.MoveNext
        rsWrk.Close
    Loop
    
    Close #1
    rsHeader.Close

Open in new window

0
Queennie LAuthor Commented:
@aikimark:

I tweak the code that you have but my output is keeps repeating header and details. I know I am almost there.

My code:

On Error GoTo Err_Command25_Click
Dim strpath As String
Dim sfilter As String
Dim sfile As String
Dim lsCurPath As String
Dim rs As New ADODB.Recordset
Dim rsWrk As New ADODB.Recordset
'Dim rsWrk As DAO.Recordset
Dim rsHeader As New ADODB.Recordset
Dim rsDetail As New ADODB.Recordset
Dim TempBatch As String
Dim tempdate As String
Dim tempExtension As String
Dim lsUserID As String
Dim lsCommentVal As String
Dim lsCurrComment As String
Dim lsTempComment As String
Dim defaultIfNull As String
Dim lsCurCompanyID As String
Dim tranType As String
Dim detailType As String
Dim headerType As String
Dim useTaxType As String
Dim S As String
Dim tempInvoice As String
Dim lsquantity As String
Dim taxString As String
Dim vBatch As Date
Dim lsCurInvoiceNo As String
Dim detailDesc As String
Dim lsVendorID As String
Dim vHeaderFilter As String
Dim sqlstr As String
    
    lsUserID = "admin"
    lsCommentVal = "0"
    lsTempComment = "Import-Invoice No:"
    defaultIfNull = "1"
    lsCurCompanyID = "Canton"
    taxString = "000 NOT TAXABLE"
    tranType = "401"
    detailType = "D"
    headerType = "V"
    useTaxType = "X"
    lsquantity = "1"
    S = ";"
    detailDesc = ""
    sfile = "APInvoices_"
    vHeaderFilter = ""
    
 
       
    If Len(strpath) <= 0 Then
        strpath = "\\network\project\development\"
    End If
    
    sfilter = "del" & Chr(0) & "*.*" & Chr(0)
    
    'open browse file box for input file
    lsCurPath = ahtCommonFileOpenSave(, strpath, sfilter, , , sfile, "Choose a Location for AP Invoice Export...", , False)
     
     If lsCurPath = "" Then
        MsgBox "The Export Invoices operation was canceled.", , " "
        GoTo Cancel_Command25_Click
    End If
    
    'set filename of export file
    lsCurPath = lsCurPath & ".del"
    
    'open text file
    Open lsCurPath For Output As #1
    
    sqlstr = "Select * from tblMainAPImport " & vHeaderFilter & " ORDER BY InvoiceNo"
    Set rsHeader = New ADODB.Recordset
    
    rsHeader.Open sqlstr, CurrentProject.Connection, adOpenStatic, adLockPessimistic
    
     Do Until rsHeader.EOF
      
    lsVendorID = rsHeader.Fields("VendorID").Value
    lsCurInvoiceNo = rsHeader.Fields("InvoiceNo").Value

    
        If rsHeader.Fields("InvoiceTotal") < 0 Then
            tranType = "402"
        Else
            tranType = "401"
        End If
        
        'write to text file in MAS import format
       
       
        
        Print #1, headerType; S; S; S; lsVendorID; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; lsVendorID; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!InvoiceDate); S; lsCurInvoiceNo; S; tranType; S; S; defaultIfNull; S; lsUserID; S; S; S; S; S; S; Format(rsHeader!InvoiceDueDate, "mm/dd/yyyy"); S; S; S; S; S; S; S; S
        
        rsHeader.MoveNext
        lsCurrComment = lsTempComment & Trim(lsCurInvoiceNo)
        
        'open detail and write to .del file
        Set rsDetail = New ADODB.Recordset
        sqlstr = "Select d.* from tblMainAPImport d" _
            & " where d.InvoiceNo = '" & lsCurInvoiceNo & "'" & " ORDER By d.InvoiceNo"
            rsDetail.Open sqlstr, CurrentProject.Connection, adOpenStatic, adLockPessimistic
            
         
        Do While Not rsDetail.EOF
        
       
         
        Print #1, detailType; S; S; lsCommentVal; S; Trim(rsDetail!TransDesc); S; Trim(rsDetail!InvoiceTotal); S; S; S; Trim(lsCurrComment); S; S; S; lsquantity; S; S; Trim(rsDetail!FullGLAcctNo); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; taxString; S; S; S; S; S; S; S; S; S; S
      
        
        rsDetail.MoveNext
        Loop
        
        
        rsHeader.MoveNext
        Loop
        
        
        rsDetail.Close
        rsHeader.Close
    Close #1
    
    MsgBox "The Import Invoice has been created.", vbOKOnly, "Export Complete!"
        
    'Set rsWrk = Nothing
    Set rsDetail = Nothing
    Set rsHeader = Nothing
    
   
On Error Resume Next

Exit_Command25_Click:
    Close #1
    Exit Sub
    
Cancel_Command25_Click:
  '
    GoTo Exit_Command25_Click

Err_Command25_Click:

    GoTo Cancel_Command25_Click

Open in new window


Please  help.

Thanks.
APInvoices-Output.txt
0
Queennie LAuthor Commented:
@aikimark:

It stops at rsHeader.open
0
aikimarkCommented:
Go back to the code I posted and start with that.  You have tweaked the code too much.

Since you're in an Access environment, instantiate your recordset variables like this:
set rsHeader = dbEngine(0)(0).OpenRecordset(strSQL, adOpenStatic)

Open in new window

0
Queennie LAuthor Commented:
@aikimark:


When I run the code it has an error message:

Run-time error '3001':
Invalid argument.
0
aikimarkCommented:
WHERE?
0
Queennie LAuthor Commented:
set rsHeader = dbEngine(0)(0).OpenRecordset(strSQL, adOpenStatic)


It stops right here.
0
aikimarkCommented:
replace strSQL with actual SQL
0
Queennie LAuthor Commented:
It is the same problem. Run-time error 3001.
0
aikimarkCommented:
Please post a database, containing some representative sample of the tblMainAPImport table.

What version of Access are you using?
0
Queennie LAuthor Commented:
Attached is the sample of tblMainAPImport table database.

Access 2007

Thank you for your help.
APInvoice.accdb
0
aikimarkCommented:
This routine:
Sub Q_28508088()
Dim strpath As String
Dim sfilter As String
Dim sfile As String
Dim lsCurPath As String
Dim rs As Recordset
Dim rsWrk As Recordset
Dim rsHeader As Recordset
Dim rsDetail As Recordset
Dim TempBatch As String
Dim tempdate As String
Dim tempExtension As String
Dim lsUserID As String
Dim lsCommentVal As String
Dim lsCurrComment As String
Dim lsTempComment As String
Dim defaultIfNull As String
Dim lsCurCompanyID As String
Dim tranType As String
Dim detailType As String
Dim headerType As String
Dim useTaxType As String
Dim S As String
Dim tempInvoice As String
Dim lsquantity As String
Dim taxString As String
Dim vBatch As Date
Dim strSQL As String
  
    
    lsUserID = "admin"
    lsCommentVal = "0"
    lsTempComment = "Import-Invoice No:"
    defaultIfNull = "1"
    lsCurCompanyID = "Canton"
    taxString = "000 NOT TAXABLE"
    tranType = "401"
    detailType = "D"
    headerType = "V"
    useTaxType = "X"
    lsquantity = "1"
    S = ";"
    sfile = "APInvoices_"

    If Len(strpath) <= 0 Then
        strpath = "C:\users\mark\downloads\"          '"\\network\project\development\"
    End If
    
    sfilter = "del" & Chr(0) & "*.*" & Chr(0)
    
    'open browse file box for input file
    With FileDialog(msoFileDialogSaveAs)
        .AllowMultiSelect = False
        .Title = "Choose a Location for AP Invoice Export..."
'        .Filters.Add "del", "*.*", 1
        .InitialFileName = strpath
        
        .Show
        If .SelectedItems.Count = 0 Then
'            MsgBox "nothing selected"
'            Exit Sub
        Else
            lsCurPath = .SelectedItems(1)
        End If
        
    End With
    
    'lsCurPath = Application.FileDialog(msoFileDialogFolderPicker).Show(, strpath, sfilter, , , sfile, "Choose a Location for AP Invoice Export...", , False)
    
   
     If lsCurPath = "" Then
        MsgBox "The Export Invoices operation was canceled.", , " "
        GoTo Cancel_cmdExportExcel_Click
    End If
    
    'set filename of export file
    'lsCurPath = lsCurPath & ".del"
        
    'open text file
    Open lsCurPath For Output As #1
    'open header and write to .del file
    Set rsHeader = DBEngine(0)(0).OpenRecordset("Select VendorID, InvoiceNo, InvoiceDate, InvoiceDueDate, Sum(InvoiceTotal) As SumOfInvoiceTotal " & _
        " from tblMainAPImport D " & _
        " Group By VendorID, InvoiceNo, InvoiceDate, InvoiceDueDate" _
        , adOpenDynamic)
    
    Do Until rsHeader.EOF
        If rsHeader!SumOfInvoiceTotal < 0 Then
            tranType = "402"
        Else
            tranType = "401"
        End If

        Print #1, headerType; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!VendorID); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; Trim(rsHeader!InvoiceDate); S; Trim(rsHeader!InvoiceNo); S; tranType; S; S; defaultIfNull; S; lsUserID; S; S; S; S; S; S; Format(rsHeader!InvoiceDueDate, "mm/dd/yyyy"); S; S; S; S; S; S; S; S
        
        strSQL = "Select ID,VendorID, InvoiceNo, InvoiceTotal, InvoiceDate, InvoiceDueDate, FullGLAcctNo, Comment from tblMainAPImport Where InvoiceNo='" & rsHeader!InvoiceNo & "' ORDER BY InvoiceNo"
        Set rsWrk = DBEngine(0)(0).OpenRecordset(strSQL, adOpenDynamic)
        
        Do Until rsWrk.EOF
            'write to text file in MAS import format
            Print #1, detailType; S; S; lsCommentVal; S; S; Trim(rsWrk!InvoiceTotal); S; S; S; Trim(lsTempComment & Trim(rsWrk!InvoiceNo)); S; S; S; lsquantity; S; S; Trim(rsWrk!FullGLAcctNo); S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; S; taxString; S; S; S; S; S; S; S; S; S; S
        
            rsWrk.MoveNext
        Loop
        
        rsHeader.MoveNext
    Loop
    
    Close #1
    rsHeader.Close
    rsWrk.MoveFirst
    rsWrk.Close
    
MsgBox "The AP Invoice has been created.", vbOKOnly, "Export Complete!"
        
    Set rsWrk = Nothing
    Set rsDetail = Nothing
    Set rsHeader = Nothing

Exit_cmdExportExcel_Click:
    Close #1
    Exit Sub
Cancel_cmdExportExcel_Click:
         GoTo Exit_cmdExportExcel_Click
End Sub

Open in new window

produces the attached file.
API.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Queennie LAuthor Commented:
@aikimark:

This is what I needed.

You are awesome smart.

I appreciate your help.

Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.