check query exists else msgbox "query missing"

  • Thread starter Thread starter BrightIdeas
  • Start date Start date
B

BrightIdeas

Before running code I would like to check the result query has been
created and is still in the database.
check query exists else msgbox "query missing"

What code would I use ? is this an error thing or is there some code
for "query does exist"?


thanks
 
Public Function QueryExists(QueryName As String) As Boolean
On Error Resume Next

QueryExists = IsObject(CurrentDb().QueryDefs(QueryName))

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top