Hi all,

I am creating a UserForm that performs search and Replace type functions. I search the document by a Project ID and the results are populated into the UserForm. Here is the issue I am having. I have multiple data per ProjectID and I want to be able to cycle through the entries by using a next button.

The code I have below works but only for the first entry. Any suggestions you might have for going about this would be greatly appreciated!



Private Sub UserForm_Initialize() 
txtProjectID2.Locked = True
End Sub

Private Sub CommandButton2_Click()
row_number = 1
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("Permitting Agency Information").Range("A" & row_number)
    If item_in_review = txtProjectID2.Text Then
        txtPermitAgencyName1.Text = Sheets("Permitting Agency Information").Range("B" & row_number)
        txtPermitNumber1.Text = Sheets("Permitting Agency Information").Range("C" & row_number)
        cmboPermitStatus1.Text = Sheets("Permitting Agency Information").Range("D" & row_number)
        txtApplicationDate1.Text = Sheets("Permitting Agency Information").Range("E" & row_number)
    End If
Loop Until item_in_review = ""
End Sub