AW: [AccessD] Does Query Exist In Access Queries

Garraway, Alun Alun.Garraway at otto.de
Tue Dec 2 10:43:21 CST 2003


hi Paul,

got this from somebody at work, might be useful...

alun


 QryNameandDescription()
On Error Resume Next

   Dim dbs As DAO.Database
   Dim qdfNew As DAO.QueryDef
   Dim qdfLoop As DAO.QueryDef
   Dim qry As DAO.QueryDef

   Set dbs = CurrentDb()
   
    With dbs
      
        Set qdfNew = .CreateQueryDef()
        qdfNew.name = "NewQueryDef"
        
        .QueryDefs.Append qdfNew

        Debug.Print "Queries in " & .name

        For Each qdfLoop In .QueryDefs
            If qdfLoop.name Like "qry*" Then
                Debug.Print qdfLoop.Properties("Name") & " / " & qdfLoop.Properties("Description") & Chr(13)
            End If
        Next qdfLoop
  
        .QueryDefs.Delete qdfNew.name

        .Close
    
    End With





-----Ursprüngliche Nachricht-----
Von: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]Im Auftrag von
paul.hartland at fsmail.net
Gesendet: Dienstag, 2. Dezember 2003 16:54
An: accessd
Betreff: [AccessD] Does Query Exist In Access Queries


To all,
I'm sure I have done this before but can't find the code anywhere and can't figure out how to do it, basically I want to know if a query called qryProgrammeAvailability exists before I delete it via VB/VBA
Thanks in advance for you help.
Paul Hartland
Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month 
www.freeserve.com/anytime
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list