Your description does not provide enough information. What kind of query is q1? The title of the thread mentions sqlquery, but I cannot believe this because then you'd filter the query result by the sql clause, not by the OnFilterRecord event.
Ideally you should provide a simple small compilable project which shows the error. Remove everything from your project which is not related to this issue and check that the bug still exists, then upload the .pas, .lfm, .lpi, .lpr and database file, all packed into a shared zip.