T
Tony Vrolyk
I am using the following code to check the existance of a query. However it
seems that it only returns true on a new query after closing the db and
reopening? Is there a way around this?
Public Function fDoesQueryExist(strQueryName As String) As Boolean
Dim db As Database
Dim qdf As QueryDef
Set db = DBEngine(0)(0)
fDoesQueryExist = False
For Each qdf In db.QueryDefs
If qdf.Name = strQueryName Then fDoesQueryExist = True
Next qdf
Set db = Nothing
End Function
Thanks
Tony Vrolyk
seems that it only returns true on a new query after closing the db and
reopening? Is there a way around this?
Public Function fDoesQueryExist(strQueryName As String) As Boolean
Dim db As Database
Dim qdf As QueryDef
Set db = DBEngine(0)(0)
fDoesQueryExist = False
For Each qdf In db.QueryDefs
If qdf.Name = strQueryName Then fDoesQueryExist = True
Next qdf
Set db = Nothing
End Function
Thanks
Tony Vrolyk