A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Position of Cursor in field



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2006, 08:55 AM posted to microsoft.public.access.forms
Frank Wagner
external usenet poster
 
Posts: 34
Default 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  
Old December 19th, 2006, 10:22 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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  
Old December 19th, 2006, 01:29 PM posted to microsoft.public.access.forms
Frank Wagner
external usenet poster
 
Posts: 34
Default 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  
Old December 19th, 2006, 01:36 PM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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  
Old December 19th, 2006, 06:21 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default 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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.