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
|
|||
|
|||
Where the cursor starts after clicking no a text box
Hello,
I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. |
#2
|
|||
|
|||
Where the cursor starts after clicking no a text box
In the on click event of the field insert the code
Me![VariableName].SelStart = 0 with VariableName being whatever you named your text box. 1genxer wrote: Hello, I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Where the cursor starts after clicking no a text box
I was all excited, but it didn't work I am getting an error. It says: "The
expression On Click you entered as the event property setting produced the following error: The Object doesn't contain the Automation object 'Me'. "nlburgess via AccessMonster.com" wrote: In the on click event of the field insert the code Me![VariableName].SelStart = 0 with VariableName being whatever you named your text box. 1genxer wrote: Hello, I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Where the cursor starts after clicking no a text box
The cause of the problem is that the field has a formating mask
IF you can live without that preformating then you can take it out and it will act like most other fields. Ron |
#5
|
|||
|
|||
Where the cursor starts after clicking no a text box
First, it is NOT a variable, it is a control. Second, the click event will
not fire every time you enter the control. The code should be in the GotFocus Event. -- Dave Hargis, Microsoft Access MVP "nlburgess via AccessMonster.com" wrote: In the on click event of the field insert the code Me![VariableName].SelStart = 0 with VariableName being whatever you named your text box. 1genxer wrote: Hello, I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. -- Message posted via http://www.accessmonster.com |
#6
|
|||
|
|||
Where the cursor starts after clicking no a text box
"What exactly is a "formating mask" and "preformating?"
Neither formatting nor an Input Mask (I assume this is what Ron means) will keep .SelStart = 0 from working! The problem, I think, is revealed in the OP's line "fields that are numbers such as zip codes or phone numbers" In fields that are defined as numbers (numerical) the cursor starts from the right side of the textbox, not the left as it would for a text field. So using .SelStart = 0 moves the cursor to the beginning of the textbox, in this case the right side! The real trouble is that things like telephone "numbers" and Social Security "numbers" aren't really numbers, and shouldn't be defined as such in the underlying table! They are text that just happens to be made up entirely of digits! If you change their datatype to text, the Input Mask and the . SelStart = 0 both will work. Only data that is has the possibility of being used in mathematical calculations should be defined as numerical. Obviously, you would never use telephone "numbers" or Social Security "numbers" to do math with! BTW, the .SelStart should always be used when using an Input Mask, otherwise your data entry people who use the mouse to navigate are apt to waste a lot of time. Linq -- 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
|
|||
|
|||
Where the cursor starts after clicking no a text box
On Jan 4, 2:58*pm, "Linq Adams via AccessMonster.com" u28780@uwe
wrote: "What exactly is a "formating mask" and "preformating?" Neither formatting nor an Input Mask (I assume this is what Ron means) will keep .SelStart = 0 from working! The problem, I think, is revealed in the OP's line "fields that are numbers such as zip codes or phone numbers" In fields that are defined as numbers (numerical) the cursor starts from the right side of the textbox, not the left as it would for a text field. So using .SelStart = 0 moves the cursor to the beginning of the textbox, in this case the right side! The real trouble is that things like telephone "numbers" and Social Security "numbers" aren't really numbers, and shouldn't be defined as such in the underlying table! They are text that just happens to be made up entirely of digits! If you change their datatype to text, the Input Mask and the . SelStart = 0 both will work. Only data that is has the possibility of being used in mathematical calculations should be defined as numerical. Obviously, you would never use telephone "numbers" or Social Security "numbers" to do math with! BTW, the .SelStart should always be used when using an Input Mask, otherwise your data entry people who use the mouse to navigate are apt to waste a lot of time. * Linq -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200801/1 The property I was looking for was "Input Mask" which can be in the table definition and/or the form field definition. The input mask will cause the cursor to stop at the place where the mouse enters. Now as to why the SelStart is not overriding that I have NO IDEA. I was just attempting to give an alternate though less stylistic way of getting around the problem AND also an explanation of why the "problem" was there originally. Ron |
#8
|
|||
|
|||
Where the cursor starts after clicking no a text box
Well I tried getting the code into the Got Focus event and I got the same
error. Any other suggestions? I can always just remove the masks, but really with the phone numbers I need area codes and people don't always put them in if not prompted. "Klatuu" wrote: First, it is NOT a variable, it is a control. Second, the click event will not fire every time you enter the control. The code should be in the GotFocus Event. -- Dave Hargis, Microsoft Access MVP "nlburgess via AccessMonster.com" wrote: In the on click event of the field insert the code Me![VariableName].SelStart = 0 with VariableName being whatever you named your text box. 1genxer wrote: Hello, I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. -- Message posted via http://www.accessmonster.com |
#9
|
|||
|
|||
Where the cursor starts after clicking no a text box
There is a known bug with SP3 that causes problems with formats in controls.
Try removing the formatting and input mask and see if it works. -- Dave Hargis, Microsoft Access MVP "1genxer" wrote: Well I tried getting the code into the Got Focus event and I got the same error. Any other suggestions? I can always just remove the masks, but really with the phone numbers I need area codes and people don't always put them in if not prompted. "Klatuu" wrote: First, it is NOT a variable, it is a control. Second, the click event will not fire every time you enter the control. The code should be in the GotFocus Event. -- Dave Hargis, Microsoft Access MVP "nlburgess via AccessMonster.com" wrote: In the on click event of the field insert the code Me![VariableName].SelStart = 0 with VariableName being whatever you named your text box. 1genxer wrote: Hello, I have tried looking through the other threads but have not seen the answer to my question. Hopefully someone can help with this today. I have a simple form I made for a table to collect customer info for a mailing list. This form is used like a kiosk at trade shows. Anyway, when you click on any fields that are numbers such as zip codes or phone numbers, the cursor starts in the text box where you clicked. Is there a way to make the cursor start on the left side no matter where the user clicked? Please help ASAP as I have a show tomorrow and am pulling out my hair trying to find an answer. Thanks! P.S. I tried clicking on the text to be left aligned in the properties but that doesn't help. And just for the record, the text fields do not have this problem, just number fields. -- Message posted via http://www.accessmonster.com |
#10
|
|||
|
|||
Where the cursor starts after clicking no a text box
Klatuu:
"Second, the click event will not fire every time you enter the control. The code should be in the GotFocus Event." Actually, you right and you're wrong, Klatuu! Placing the code in the GotFocus event will have no effect when the textbox is entered by way of clicking with the mouse! It doesn't make a lot of dince, but we're talking about Access here! I know this because I've been using this type of code since ACC2000. It does have to be placed in GotFocus as well, ***unless*** in Options.- Keyboard - Behavior Entering Field the option is set to "Go to start of field." As I stated earlier, I think his problem is because the fields are numerical, and so the "start" of the field is the right hand side of the textbox, not the left hand side, as it is for text fields. -- 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 |
|
Thread Tools | |
Display Modes | |
|
|