Looping through two arrays in a nested for statement

I have a process where users can select one or more documents to archive.  They also have the option of changing the name, however, if they do this, I need to pass both the original name as well as the new name to the procedure for a file copy.  I have two text boxes, one holds the "new" name and the other holds the "orignal" name.  So what I need is if the user, say for document 3, they change the name, I need the procedure to grab the corresponding original name from the "original" text box so it knows which file to copy.  The "new" textbox and the "original" name texbox are in tandem, that is, the positions of the items are the same in both so item 3 in both arrays refer to the same document.  As the loop goes through the array, I need both the strOriginalDocName as well as teh strSaveDocName to be passed to the RecordArchive procedure.  
Dim arrArchive() As String
Dim arrOriginal() As String
Dim i As Integer

arrArchive = Split(Me.txtDocument, ",")
arrOriginal = Split(Me.txtOriginalName, ",")

For i = 0 To UBound(Arr)
strSaveDocName = arrArchive(i) & "_" & Me.txtEmpFRBEmployeeNumber
strOriginalDocName = arrOriginal(i) & "_" & Me.txtEmpFRBEmployeeNumber
    'Check to see if file already exists in destination folder
    If fntFileExists(strPath & strSaveDocName) Then
        varResponse = MsgBox("This file exists already, do you wish to overwrite?" & vbCrLf & _
               "If not, hit No so you can change the document name " & vbCrLf & _
               "or simply close the form.", vbYesNo)
        If varResponse = 7 Then  'vbYesNo are really integer return values
            Exit Sub
           Call RecordArchive(strDir, strOriginalDocName, strPath, strSaveDocName, True)
        End If
        Call RecordArchive(strDir, strOriginalDocName, strPath, strSaveDocName, False)
    End If
Next i

Open in new window

Sandra SmithRetiredAsked:
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.

Rey Obrero (Capricorn1)Commented:
where did you define the array "Arr"

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
Sandra SmithRetiredAuthor Commented:

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 Applications

From novice to tech pro — start learning today.