
Testing for existence of a query
Quote:
>I use CreateQueryDef to create a temporary query and DeleteObject to
>delete it when I've finished. Before I use CreateQueryDef I'd like to test
>to see if a rogue query has been left over from earlier so that the
>CreateQueryDef doesn't fail. I'm sure there is a
>DoesQueryExist("queryname") function or similar, but I haven't yet found
>it.
>Thanks for any help.
>Robert
Robert
There are several ways you can do this, including just trying to delete the
query, and trapping the error that occurs if the query doesn't exist. For more
info, look at this page on my site, which is about TableDefs, but the theory is
the same - http://www.applecore99.com/index.asp?page=tbl002
Jon
Access tips & tricks - http://www.applecore99.com
Microsoft Access webring - http://a.webring.com/hub?ring=microsoftaccess