UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> Query exist    

'Example use: If QueryExists("qryMyQuery") Then
' Does not find System Queries

'   Code courtesy of UtterAccess Wiki
'   http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary
'   Original submission by Hunter57
'   on 7 October 2010
'   You are free to use it in any application,
'   provided this copyright notice is left unchanged.

Public Function QueryExists(strQueryName As String) As Boolean

   Dim accQry As AccessObject
   QueryExists = False 'Default Value remains False unless Query is found
   ' Use the CurrentData.AllQueries Collection to get only saved queries
   ' Loop through the list of saved queries to get the names
   For Each accQry In CurrentData.AllQueries
       If strQueryName = accQry.Name Then
           QueryExists = True 'We found the Query
           Exit For ' Exit the Loop
       End If
   Next accQry

End Function

Creative Commons License
Query exist by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.

Edit Discussion
Custom Search

Thank you for your support!
This page has been accessed 5,292 times.  This page was last modified 09:39, 6 April 2011 by Jack Leach. Contributions by Alan Greenwood and Hunter57  Disclaimers