Can you place the code with the [ code ] and [ / code ] delimiters, it will make it a lot easier to read.
The only thing I can think of is to msgbox or toastmessageshow the aid variable before executing the SQL, this has probably changed and therefore doesn't match any of the rows.. You would be able to tell really quickly if it is the case, by seeing what the variable is before executing the SQL.