In Distress
New Member
- Joined
- Mar 12, 2003
- Messages
- 37
Howdy all,
I've got another amateur question for you all.
I have a textbox on a userform called Screen001_TB_EmployeeNameEntry that has a default value of "Enter your name here". My question (and probably the solution) is simple, on the Screen001_TB_EmployeeNameEntry_Enter event, I have the text in the textbox highlighted. Now, when a user starts to enter their name, I want the default text to be deleted and the name the user enters to be placed in the textbox. I'm gathering it can be done by using the KeyPress event but I'm not sure how.
Now, I hear you thinking - if the text is highlighted then any key pressed will delete the highlighted text and replace it with the key pressed, but my problem is, what if someone simply places the cursor half way through the default text and starts typing..........instant disaster. Hence the reason I want the default value to disappear regardless of wether or not the default text is highlighted or not.
Hopefully that all makes sense.
Thanks in advance again.
I've got another amateur question for you all.
I have a textbox on a userform called Screen001_TB_EmployeeNameEntry that has a default value of "Enter your name here". My question (and probably the solution) is simple, on the Screen001_TB_EmployeeNameEntry_Enter event, I have the text in the textbox highlighted. Now, when a user starts to enter their name, I want the default text to be deleted and the name the user enters to be placed in the textbox. I'm gathering it can be done by using the KeyPress event but I'm not sure how.
Now, I hear you thinking - if the text is highlighted then any key pressed will delete the highlighted text and replace it with the key pressed, but my problem is, what if someone simply places the cursor half way through the default text and starts typing..........instant disaster. Hence the reason I want the default value to disappear regardless of wether or not the default text is highlighted or not.
Hopefully that all makes sense.
Thanks in advance again.