You can create a method in form named i.e. DayOfTheYear & put the code from my form into it.
About the mail you sent me. Can you send whole form not only the KeyPress event, because I didn't uderstand what is happening.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.