Query is not a valid file name...

AccessInsanity

New member
Local time
Today, 08:07
Joined
Aug 7, 2013
Messages
3
Hello,

I have been fighting this problem for two days, and I don't know what to do. I am trying to build a query so that a search form can be created to run the query for the end user. Everything goes well until when I attempt to have the query run from the form, and then the error message emerges "___ is not a valid file name. Make sure that it does not include invalid characters..." with ____ being the query name. Renaming the query doesn't change anything. I've named it Query1 (default name), Mainquery, HELP, I'm at a loss. Is this a bug with Access?

Thanks
 
Please post the code and the SQL of the query.
 
maybe as simple as puuting the queryname inside " characters

docmd.openquery "qryname"

not

docmd.openquery qryname

----
if you are trying the latter and not getting compile errors, then maybe you do not have option explicit set - in which case access will create a blank variable called qryname - set to nothing, which may be why your error message look like it does.

-----
otherwise please post the code you are using in the form, to try and run your query.
 

Users who are viewing this thread

Back
Top Bottom