>OK,
>
>I got the cursor to stay in the textbox by returning 0. One problem though, if I hit the cancel button on my form I don't want it to do the function inside the valid event of that textbox which it does everytime I want to leave that text box. I only want the code to happen when I hit enter on the keyboard. Valid might not be the correct function. How could I get around that?
>
>Thanks for your help everyone.
If this is the case, you should use KeyPress method, as Eric suggested. Something like:
if nKey=13 && Enter
nodefault
endif
If it's not broken, fix it until it is.
My Blog