SOLVED How to Make an If Statement go to a line of code
Hi, i am getting quite a way into my module now! So first of all, thank you to everyone on here and over the rest of the internet for your help.
I am trying to write an if statement that allows the user to go back and select a file again in case they selected the wrong one the first time.
My question is how do i sort my if statement so it sends the user back a step to the "Please Browse" stage - however, at the moment if you click "Yes" when it asks to select another file it executes the exit application part anyway.
Anyone know how i need to phrase the if statements?
Hi, i am getting quite a way into my module now! So first of all, thank you to everyone on here and over the rest of the internet for your help.
I am trying to write an if statement that allows the user to go back and select a file again in case they selected the wrong one the first time.
My question is how do i sort my if statement so it sends the user back a step to the "Please Browse" stage - however, at the moment if you click "Yes" when it asks to select another file it executes the exit application part anyway.
Anyone know how i need to phrase the if statements?
Dim SQLFile As String
SQLFile = Application.GetOpenFilename(, , "Please Browse to ABCNTSTR SQL Download", , False)
importsqlcheck = MsgBox("Are you sure you want to import this file?" & Chr$(13) & SQLFile, vbYesNo, "Confirm File to Import")
If importsqlcheck = vbNo Then
importtryagain = MsgBox("Update Failed. Select Another File?", vbYesNo, "Retry?")
Else
End If
If importryagain = vbYes Then
'???????????????????????????????????????????????
Else
Application.DisplayAlerts = False
ExpiredReport.Close savechanges = False
MsgBox ("Update Failed")
Application.Quit
End
End If
Last edited: