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
|
|||
|
|||
Cursor position
Hello,
When I tab from one control to another or use docmd.gotoControl the control gets highlighted automatically. Is there a way to put the cursor at the end of the control or at the beginning of the control without highlighting the control? Thanks Abe |
#2
|
|||
|
|||
Cursor position
On Mon, 11 Jan 2010 16:04:58 -0500, "Abe Katz" wrote:
Hello, When I tab from one control to another or use docmd.gotoControl the control gets highlighted automatically. Is there a way to put the cursor at the end of the control or at the beginning of the control without highlighting the control? Thanks Abe Take a look at the SelStart and SelLen properties: Me!controlname.SelStart = Len(Me!controlname) Me!controlname.SelLen = 0 will put the cursor at the end, with nothing selected. It might need to be Len(...) + 1, I haven't used it in a while! -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Cursor position
Abe,
There are two situations... When you Tab into the field, or when you mouse click into the field. (ex. LastName) This code covers both... **For cursor at the Beginning of the text string... Private Sub LastName_Click() LastName.SelStart = 0 LastName.SelLength = 0 End Sub Private Sub LastName_Enter() LastName.SelStart = 0 LastName.SelLength = 0 End Sub **For Cursor at End of the text string... Private Sub LastName_Click() LastName.SelStart = Len(LastName) LastName.SelLength = 0 End Sub Private Sub LastName_Enter() LastName.SelStart = Len(LastName) LastName.SelLength = 0 End Sub -- hth Al Campagna Microsoft Access MVP 2006-2009 http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Abe Katz" wrote in message ... Hello, When I tab from one control to another or use docmd.gotoControl the control gets highlighted automatically. Is there a way to put the cursor at the end of the control or at the beginning of the control without highlighting the control? Thanks Abe |
#4
|
|||
|
|||
Cursor position
On Mon, 11 Jan 2010 17:01:27 -0500, "Al Campagna"
wrote: When you Tab into the field, or when you mouse click into the field. (ex. LastName) Hrm. I just use GotFocus() to cover both these cases. I can see that you might want to distinguish them though... -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Cursor position
John,
Oh you know me... I always rely on "brute force" in my coding. :-D Al "John W. Vinson" wrote in message ... On Mon, 11 Jan 2010 17:01:27 -0500, "Al Campagna" wrote: When you Tab into the field, or when you mouse click into the field. (ex. LastName) Hrm. I just use GotFocus() to cover both these cases. I can see that you might want to distinguish them though... -- John W. Vinson [MVP] |
#6
|
|||
|
|||
Cursor position
On Mon, 11 Jan 2010 21:54:11 -0500, "Al Campagna"
wrote: John, Oh you know me... I always rely on "brute force" in my coding. :-D Al A programmer who lived in Racine Said, "I can overload any machine - My secret's aversion To loops and recursion: Just acres of in-line routine!" -- John W. Vinson [MVP] |
#7
|
|||
|
|||
Cursor position
Good one!
And, OT... but one of my favorites... "Even fleas have little fleas upon their backs to bite 'em. And little fleas have littler fleas... and so on... ad infinitum." Al "John W. Vinson" wrote in message ... On Mon, 11 Jan 2010 21:54:11 -0500, "Al Campagna" wrote: John, Oh you know me... I always rely on "brute force" in my coding. :-D Al A programmer who lived in Racine Said, "I can overload any machine - My secret's aversion To loops and recursion: Just acres of in-line routine!" -- John W. Vinson [MVP] |
#8
|
|||
|
|||
Cursor position
On Tue, 12 Jan 2010 06:17:41 -0500, "Al Campagna"
wrote: Good one! And, OT... but one of my favorites... "Even fleas have little fleas upon their backs to bite 'em. And little fleas have littler fleas... and so on... ad infinitum." to which a physicist replied... Great vortices have lesser ones that feed on their velocity; The lesser ones have lesser ones and so on, to viscosity. -- John W. Vinson [MVP] |
#9
|
|||
|
|||
Cursor position
Ha... a keeper!
Al "John W. Vinson" wrote in message ... On Tue, 12 Jan 2010 06:17:41 -0500, "Al Campagna" wrote: Good one! And, OT... but one of my favorites... "Even fleas have little fleas upon their backs to bite 'em. And little fleas have littler fleas... and so on... ad infinitum." to which a physicist replied... Great vortices have lesser ones that feed on their velocity; The lesser ones have lesser ones and so on, to viscosity. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|