left align

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.
 
A

Arvin Meyer [MVP]

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
 
C

cmichaud

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.
 
B

BruceM

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
 
C

cmichaud

It is rejecting the command. Giving me an error. Then highlighting
..SelStart in the code.

Any ideas?
 

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

Top