I must be missing something here.
My assumption: Module Name is the name of a field on your report. Is that correct?
What do you want to happen when a certain module name in your report?
My thinking is, if my assumption is correct, that you don't need to loop through the records, as the query is already doing that. If you want to check to see if a certain module exists, put the name of that certain module in the criteria of the Module Name column in the query.