Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default forms / text boxes

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........
--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default forms / text boxes

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)

--
Regards,
Tom Ogilvy


"JT" wrote in message
...
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........
--
JT



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Templates/Forms/Boxes in Excel 85225 Excel Discussion (Misc queries) 4 March 24th 06 06:11 PM
Boxes in Forms PaulW Excel Discussion (Misc queries) 0 March 10th 06 03:18 PM
Setting Property Values of Text Boxes within Forms SkyEyes Excel Programming 1 July 1st 05 07:06 PM
Forms - Dropdown Boxes Olivia Excel Programming 0 November 18th 04 09:43 PM


All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"