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
|
|||
|
|||
Position of Cursor in field
I have one text box on my form where I would like the cursor to go to the end
of the data in the field so I can enter more data. All the other text boxes I would like to have the cursor enter so I can replace any the data already in the field I don't know how to do that Any help would be appreciated -- Frank Wagner |
#2
|
|||
|
|||
Position of Cursor in field
In the Enter event of the text box, set SelStart to SelLength.
-- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Frank Wagner" wrote in message ... I have one text box on my form where I would like the cursor to go to the end of the data in the field so I can enter more data. All the other text boxes I would like to have the cursor enter so I can replace any the data already in the field I don't know how to do that Any help would be appreciated -- Frank Wagner |
#3
|
|||
|
|||
Position of Cursor in field
Allen
Thanks for the response. I'm not quite sure how to implement your solution. I have Access 2000, and the only Enter event I can see for the text box is "On Enter", and there is not an option called selStart that I can see. Where do I put SelStart? Thanks -- Frank Wagner "Allen Browne" wrote: In the Enter event of the text box, set SelStart to SelLength. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Frank Wagner" wrote in message ... I have one text box on my form where I would like the cursor to go to the end of the data in the field so I can enter more data. All the other text boxes I would like to have the cursor enter so I can replace any the data already in the field I don't know how to do that Any help would be appreciated -- Frank Wagner |
#4
|
|||
|
|||
Position of Cursor in field
1. Set the On Enter property of the text box to:
[Event Procedure] 2. Click the Build button (...) beside this. Access opens the code window. 3. Set up the code so it looks like this, replacing Notes with the name of your field: Private Sub Notes_Enter() With Me.[Notes] If Not IsNull(.Value) Then .SelStart = Len(.Value) End If End With End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Frank Wagner" wrote in message ... Allen Thanks for the response. I'm not quite sure how to implement your solution. I have Access 2000, and the only Enter event I can see for the text box is "On Enter", and there is not an option called selStart that I can see. Where do I put SelStart? Thanks -- Frank Wagner "Allen Browne" wrote: In the Enter event of the text box, set SelStart to SelLength. "Frank Wagner" wrote in message ... I have one text box on my form where I would like the cursor to go to the end of the data in the field so I can enter more data. All the other text boxes I would like to have the cursor enter so I can replace any the data already in the field I don't know how to do that Any help would be appreciated -- Frank Wagner |
#5
|
|||
|
|||
Position of Cursor in field
Here you go, Frank!
'This sets cursor at the end of current text Private Sub YourTextBox_Enter() Me.YourTextBox.SelStart = Len(YourTextBox.Value) End Sub 'This sets cursor at the beginning of current text Private Sub YourTextBox_Enter() Me.YourTextBox.SelStart = 0 End Sub 'This selects (hi-lites) all of the current text Private Sub YourTextBox_Enter() Me.YourTextBox.SelStart = 0 Me.YourTextBox.SelLength = Len(YourTextBox.Value) End Sub Allen Browne wrote: In the Enter event of the text box, set SelStart to SelLength. I have one text box on my form where I would like the cursor to go to the end [quoted text clipped - 7 lines] Any help would be appreciated -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#6
|
|||
|
|||
Position of Cursor in field
That does it. Thanks for all your help
-- Frank Wagner "Frank Wagner" wrote: I have one text box on my form where I would like the cursor to go to the end of the data in the field so I can enter more data. All the other text boxes I would like to have the cursor enter so I can replace any the data already in the field I don't know how to do that Any help would be appreciated -- Frank Wagner |
Thread Tools | |
Display Modes | |
|
|