If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
phone textbox default value problem
I have a phone field and I have a default area code set and when I tab to the
field the area code is highlighted and I have to click off of it to enter data. How can I have it so when I tab to the field I can immediatly start typing the phone number after the area code? If the area code is different than the default I figure I could just back space and change it. 90% of the time the default will be correct. I have the input mask as !\(999") "000\-0000;0;_ and the default value as (916), I am leaving the formatting info in because I have to import the data and it has the " ( ) - " in the imported data any other suggestions would be appreciated, thnx, Arnold |
#2
|
|||
|
|||
phone textbox default value problem
Use the SelStart property of the control. For example, in the GotFocus event
you would put a line of code like; Me![PhoneControlName].SelStart = 5 You may want to put this in multiple events like OnClick, GotFocus, etc. to cover the different ways a user can enter the control. HTH -- _________ Sean Bailey "Arnold Klapheck" wrote: I have a phone field and I have a default area code set and when I tab to the field the area code is highlighted and I have to click off of it to enter data. How can I have it so when I tab to the field I can immediatly start typing the phone number after the area code? If the area code is different than the default I figure I could just back space and change it. 90% of the time the default will be correct. I have the input mask as !\(999") "000\-0000;0;_ and the default value as (916), I am leaving the formatting info in because I have to import the data and it has the " ( ) - " in the imported data any other suggestions would be appreciated, thnx, Arnold |
#3
|
|||
|
|||
phone textbox default value problem
Beetle Bailey's right on the money! And it does need to be in the OnClick
event as well! For some bizarre reason, when the textbox gets focus by clicking on it, the GotFocus event doesn't fire! -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200801/1 |
#4
|
|||
|
|||
thank you that works
thank you that works great
I found the default input mask puts a space after the area code so you either have to take the space out of the input maks or add a space after the default area code and make the code Me![GuCell].SelStart = 6 instead of a five. |
#5
|
|||
|
|||
space at end of default value
The data I am importing has a space between the area code and the number. For
the default value how do you get a space after the area code? |
#6
|
|||
|
|||
space at end of default value
After re-reading your posts I find myself more confused than usual! You state
that you're importing your data THEN you speak of entering your phone data! Is it one or the other or both? -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200801/1 |
#7
|
|||
|
|||
space at end of default value
Hi Arnold,
Input masks make life much more difficult for both developer and user as you have just experienced. It is much easier in Access to just let the user type in the number (do the same with dates) Save each number in the table as a string of numbers, then you want to show the numbers on a form or report, just include a calculated field in the query which formats the number the way you want it to appear. If you wish to change the input mask, open the table with the field that has the input mask and use the wizard that appears when you click the button with the ellipsis opposite the property called input mask. You may also be able to use that same input mask for the format of the textbox control on the form. I don't use input masks any more so I'm not quite sure how it works on the form - you could check it out. Jeanette Cunningham "Arnold Klapheck" wrote in message ... The data I am importing has a space between the area code and the number. For the default value how do you get a space after the area code? |
#8
|
|||
|
|||
Answer: space at end of default value
"Arnold Klapheck" wrote:
The data I am importing has a space between the area code and the number. For the default value how do you get a space after the area code? The answer is you don't need to put a space at the end of you default value, use code Me.[TextBoxControlName].SelStart = 5 and put it for events onFocus and Click, then your cursor will be at the point you need it, ready to start typing. And yes I import data and I also input some by hand and I need to be able to export it to a database that has the areacode and phone together. |
Thread Tools | |
Display Modes | |
|
|