It's a scope issue. You DIMMED x within the Form_Load sub. This means that x isn't available
anywhere outside this sub.
Since you want to access x in several different subs within the form, declare it (DIM) at the FORM level (before any subs or functions.)
Now, you increment x every time you make a change to the text in the textbox. Suppose you have already entered
db.com (and x is equal to 6.) What happens when you press the backspace key? What happens if you highlight all the text in the textbox, and press the delete key?
VB has a built-in function which returns the length of a string... it's called
LEN. You might find it useful.