You're setting the MaxLength of 'txt' over and over when you're adding 'txt2' to the form.

I'd suggest using a MaskedTextBox, but the fact that you're using such an old version of VB means you only have the ActiveX option.