Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preformatted field

Status
Not open for further replies.

PB90

Technical User
Jul 11, 2005
65
US
Is there a way to set the cursor location to the first character position when the user clicks on a formatted field? Currently when I click on the field it usually puts me in the middle of the field (wherever the mouse clicked)
 
Have a look at the SelStart and SelLength properties of the TextBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Maybe I'm missing something.

I'm looking at the properties for the textbox, on the form.
These are the options I find:
Control Source, Format, Decimal Places, Input Mask (which is >000000LLLL00), default value, IME Hold, IME Mode, IME Sentence Mode, Validation Rule, Validation text, Enter Key behavior (default), Allow Auto Correct, Visible, Display When, Vertical, Enabled, Locked, Filter Lookup, Auto Tab, Tab Stop, Tab Index, Scroll Bars, Can Grow, Can Shrink, Left, Top, Width, Height, Back Style, Back Color, Special Effect, Border Style, Border Color, Border Width, Fore Color, Font Name, Font Size, Font Weight, Font Italic, Font Underline, Text Align, Shortcut Menu Bar, ControlTip Text, Help Context Id, Tag, Before Update, After Update, On Dirty, On Undo, On Change, On Enter, On Exit, On Got Focus, On Lost Focus, On Click, On Dbl Click, On Mouse Down, On Mouse Move, On Mouse Up, On Key Down, On Key Up, On Key Press, Reading Order, Keyboard Language, Scroll Bar Align, Numeral Shapes, Left Margin, Top Margin, Right Margin, Bottom Margin, Line Spacing, Is Hyperlink, Smart Tags


I couldn't find anything like "SelStart" or "SelLength" under properties (on either the txtbox object on the form, or on the properties of the item in the table)

Is there someplace else I need to look?
 
In the Click event procedure of the textbox:
Me![Name of TextBox].SelStart = 0
Me![Name of TextBox].SelLength = 0

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you, I misunderstood where to look, I finally found the selLength in the VB help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top