Haytham...
I am not sure why it's giving you a compile error...I typed the code in my first reply although I hadn't tested it at that time...I have used it in the past...I just cut and pasted the above code into an unbound field, changed the [YourField] part and, it worked fine on mine... I am not sure what version you are running... I have now tested the code on both access 2k and, access XP (a.k.a. access 2002).
The Code allowing you to pass on to the next field is one of the things I don't like about the code... This is where my statement "Personally...Fornatian's way will work better..." came from... As I said, the code was only meant as an option you could play with if needed...
Don