Hi,
I have created a form that allows a user to enter an excel file name. The code imports the file into a table. Then a query joins the table to another table and then exports the results out into another excel file.
When the join field (Project Number) is not in the original file, the query will not run. I have an "On Error goto clause in my code. It goes to a message box to tell the user what is wrong. I also have "DoCmd.SetWarnings False".
However, when this problem occurs, the Query Error is displayed first. Then, if the user selects "Cancel", the "On Error" clause kicks in and the user see's my message.
How can I turn this error message off. Or, better yet, how can I determine if the query will work before running it and therby giving the user the error message.
I hope all of this makes sense. Thanks in advance.
I have created a form that allows a user to enter an excel file name. The code imports the file into a table. Then a query joins the table to another table and then exports the results out into another excel file.
When the join field (Project Number) is not in the original file, the query will not run. I have an "On Error goto clause in my code. It goes to a message box to tell the user what is wrong. I also have "DoCmd.SetWarnings False".
However, when this problem occurs, the Query Error is displayed first. Then, if the user selects "Cancel", the "On Error" clause kicks in and the user see's my message.
How can I turn this error message off. Or, better yet, how can I determine if the query will work before running it and therby giving the user the error message.
I hope all of this makes sense. Thanks in advance.