left align

  • Thread starter Thread starter cmichaud
  • Start date Start date
C

cmichaud

Is there a way to set a control box on a form to always move the cursor
to left align. For instance if i have an input mask of a phone number
and click on the control box the cursor ends up where i clicked. i
want it to move to the left so i can type the number.
 
In the form's design view, make sure you have the Formatting Toolbar turned
on and set the control to Left Align. You can also set all controls to:

Tools ... Options ... Keyboard tab

set the Behavior Entering Field to Go To Start of Field
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
I have set those as you said. I have no problem if the control is a
general text box. However if there is any sort of input mask (phone
number, zip, DOB) and instead of tabing to the box i take the mouse and
click on the box the cursor goes to EXACTLY where i clicked on the box
instead of to the left. This makes entering phones numbers hard cause
you then have to backspace to get to the start of the input mask.
 
You could try something like this in the control's Click event:

Me.ControlName.SelStart = 0

Or if you want to allow the user to click where wanted to edit existing
data:

If IsNull(Me.ControlName) Then
Me.ControlName.SelStart = 0
End If
 
It is rejecting the command. Giving me an error. Then highlighting
..SelStart in the code.

Any ideas?
 
Back
Top