Code:
If strInputFileName = "" Then
If MsgBox("You Must Select A Backend. Without It, The System Cannot Run. Are You Sure?", vbYesNo, "Are You Sure?") = vbNo Then GoTo Line1
Else
MsgBox "The Database Will Now Close.", vbCritical, "Warning"
DoCmd.CloseDatabase
End If
End If
The code half works and half fails.
Basically it is checking (earlier before this code) if the current backend file actually exists, if it does then do nothing, if not then bring up a file browser and tell the user they need to choose the backend for it to work. Once the file browser opens this code is run.
It checks whether the user chooses a file or selects cancel. If they select a file then it will write the new location into the system table (haven't put that code in yet) and if they click cancel, it shows an error message stating they have to have a back end for it to work, and asks if they're sure they want to cancel. If they click no, it opens the file dialogue box again, which is working, but if they click yes, it is SUPPOSED to give them an error saying the database is going to close, and then shut it, however it is not running the else statement.
Why not??
Thanks