Access 2010 for loop skips a record on delete
Posted on 2013-11-27
I am reading through querydefs using a for loop. I am looking for 3 querydefs and deleting them if found so I can create them again later in code. I have a nested if for this inside the for loop. When I find and delete the first one, it skips the next querydef (which is another one I wish to delete). How can I get around this? Code I am using is below.
For Each qd In cd.QueryDefs
If qd.Name = "dynamicqry_formfilter" Then
If qd.Name = "dynamicqry_rptfilterAddress" Then
If qd.Name = "dynamicqry_rptfilterBeat" Then