[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Setting cursor in phone number field (text box)

Posted on 2014-02-18
3
Medium Priority
?
409 Views
Last Modified: 2014-03-02
I have an Access 2007 form, which contains a text box represented in a phone number format, e.g.

!\(999")"000\-0000

If the field is empty, I would like the cursor to be placed at the beginning of the field.
If the field contains a phone number, I would like the cursor to remain where the user clicked the field.

How would I go about doing this?

Thanks...Tom
0
Comment
Question by:tpigielski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Expert Comment

by:PatHartman
ID: 39867916
I'm not sure you can control that.  The input mask gets in the way of normal data entry.  You can try changing the "Behavior on entering field" property in  file/options/client settings but I'm not sure that would help.  I like it to select all when the user tabs into a field.  The problem is that this setting is universal so changing it changes it for EVERY database.
0
 

Accepted Solution

by:
tpigielski earned 0 total points
ID: 39886837
This in fact can be controllable.  Here is the code that I used to do this:

Private Sub txtPrimaryPhone_Click()

  If txtPrimaryPhone.Tag = True Then
    txtPrimaryPhone.Tag = False
    txtPrimaryPhone.SelStart = 0
    txtPrimaryPhone.SelLength = 0
  End If
 
End Sub

Private Sub txtPrimaryPhone_GotFocus()

    txtPrimaryPhone.Tag = True
    txtPrimaryPhone.SelStart = 0
    txtPrimaryPhone.SelLength = 0
   
End Sub

Private Sub txtPrimaryPhone_KeyUp(KeyCode As Integer, Shift As Integer)

    txtPrimaryPhone.Tag = False
   
End Sub
0
 

Author Closing Comment

by:tpigielski
ID: 39898363
Other answer did not solve my problem.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question