Show us the whole source code, that is what I always ask. If OP provides the whole compile-able source code, the issue should be able to solve in minutes.
I posted my code 28 minutes after he asked and he said that it works for him.
If OP provided the whole source code on his first post, I believe most or maybe all of us can solve it in less than 10 minutes. Compile-time errors are very easy to solve if the
whole source code is provided. Not only solving the problem, sometimes there will be suggestions for improving the code quality.
Without the compile-able source code, we just guess. But if I had it, I simple open it using Lazarus, inspect and can fully understand the problem. Lazarus is an awesome
IDE tool for debugging.
Usually posters only show some lines of the code where they believe are the cause of the issue. But often, the real problem is on somewhere else.