I used to lay the news paper between the tank and lid(or screen) to keep the ants and the other bugs away. or you could find the rubber band that smells bad like..not sure correct explanation..but smells like chemical..that kind of rubber band.. Place on your tank. like..you put the band on the around of tank.
Another and best way...is cleaning the place(or room). Ants are attracting by the smell of food especially sweet and sugary kind of food. so clean your place to keep them away and attracting them anymore, and if you have food that is left over, you must seal it completely. and use chemical killer of those bugs. spray is fine for the time you see it, but evaporate so get a better one or make one would be fine too. ants or the other insects are hardly survive after they be touched by toothpaste or mouth-washer. so get them and mix water a bit for lower the density(or thickness) and spray couple of times to where ants are mostly seen. But don't spray too much. while it dries out, it might leave the marks of the liquid.
hope it could help you out.