this is my first post here
hope you could help me..
Private Sub FindFile() On Error GoTo x 'capture if error occurs Dim idx As Integer 'index to be incremented For idx = 1 To Combo.ListCount - 1 'loop to find the and load the text file RTB.LoadFile App.Path & "\Ordinance\" & Combo.List(idx) & "\" & txtFind.Text & ".txt" 'load the text Exit For 'if found x: Next idx 'if not found End Sub
in my code, I have to catch the error which occurs when i want to load the File from an invalid directory,
I need to catch it to increment the index of my combo which contains the Exact name of sub folders where the Files are.
my problem is i can only catch the First error and increment the idx once(it can only change the Directory once)
then the error appears(The specified path/file name cannot be access )
why is that???
what's wrong with the Codes???
hope it's clear :icon_neutral: