My code does not throw an error, but it is not deleting the query either. What is the proper way to delete a query if it exists in VBA?
Code:Dim qdf As QueryDef Dim queryName As String queryName = "vbaExportQuery" For Each qdf In CurrentDb.QueryDefs If qdf.Name = "queryName" Then CurrentDb.QueryDefs.Delete queryName End If Next