forms / text boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 questions:

First, is there a way to format a text box for dates. One of the text boxes
on my form is for the user to enter a date. I would like to format the text
box so all the user has to do is enter mmddyy and the field is automatically
populated as mm/dd/yy.

Second, is there a way select the entire field in a form. Once the user
clicks enter on the form, a number of edits are performed. If there is an
issue with the field, I would like to move the cursor back to the field in
question (setfocus - no problem) but then I would like to select whatever is
in the text box, so the user can just key over the existing info.

Thanks for the help........
 
There is no formatting a textbox. You would have to use the change event or
one of the key events to handle the formatting.

use the selstart and sellength properties of the textbox

TextBox1.SelStart = 1
TextBox1.SelLength = len(textbox1.Text)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top