try something like that it would allow you to continue looping through your input loop. also probably would want to put the rest of your code in the else statement so that after checking if the file name does not exist and if it does than it goes to the else statement and runs the code you want. Let me know if this steered you in the right direction
do { //input validation
cout << "Please enter the name of the file: "; // ask the user to input file name
cin >> fileName;
inputFile.open(fileName); // open the file
} while (!inputFile);