johnnymagee
Programmer
I create a number of queries prefixed "qryTemp", i.e. "qryTemp0", "qryTemp1", "qryTemp2", etc
Previous incarnations of these queries have to be closed and deleted before making new ones. This code (sort of) works but only finds up every second relevant query. I can't see what the problem is...
const sQdfName as string = "qryTemp"
dim qdf as dao.querydef
for each qdf in currentdb.querydefs
if left(qdf.name,len(sqdfname))=sqdfname then
docmd.close acquery, qdf.name
currentdb.querydefs.delete qdf.name
end if
next
Previous incarnations of these queries have to be closed and deleted before making new ones. This code (sort of) works but only finds up every second relevant query. I can't see what the problem is...
const sQdfName as string = "qryTemp"
dim qdf as dao.querydef
for each qdf in currentdb.querydefs
if left(qdf.name,len(sqdfname))=sqdfname then
docmd.close acquery, qdf.name
currentdb.querydefs.delete qdf.name
end if
next