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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Zoom box end of text



 
 
Thread Tools Display Modes
  #1  
Old February 9th, 2010, 03:50 PM posted to microsoft.public.access
jean
external usenet poster
 
Posts: 19
Default Zoom box end of text

Hi

I have a form containing a memo field; but as there is not enough room
I add vb code on a label and when the user double-click the label zoo
box opens.
DoCmd.RunCommand acCmdZoomBox

But when the box opens, if there is already text in it, ALL the text
is highlight so if the user want to add something, he overwrites the
existing text if he don't take care..

Question :

Is there a way that when a zoom box opens, the cursor goes all the
time at the end of text ?

thanks
  #2  
Old February 9th, 2010, 05:23 PM posted to microsoft.public.access
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Zoom box end of text

You could remove the highlight by sending a keystroke:

SendKeys "{RIGHT}"
DoCmd.RunCommand acCmdZoomBox

That would leave the text in the zoom box completely unselected, however,
rather than with the insertion point at the end of the text. A better method
would be to create an unbound dialogue form, frmMemoDlg, with a large text
box, txtMemo on it. In the dialogue form's Open event procedure assign the
value of the control on the bound form to the text box with:

Dim ctrl As Control

Set ctrl = Me.txtMemo

ctrl = Forms("YourBoundForm").YourMemoControl
ctrl.SetFocus
ctrl.SelLength = 0
ctrl.SelStart = Len(ctrl)

and in its Close event procedure assign the value of the text box back to the
bound control:

Forms("YourBoundForm").YourMemoControl = Me.txtMemo

You could make the above line conditional on the user confirming the update
in a message box if you wished.

Then in the double-click event procedure in the bound form open the dialogue
form:

DoCmd.OpenForm "frmMemoDlg", WindowMode:=acDialog

Ken Sheridan
Stafford, England

jean wrote:
Hi

I have a form containing a memo field; but as there is not enough room
I add vb code on a label and when the user double-click the label zoo
box opens.
DoCmd.RunCommand acCmdZoomBox

But when the box opens, if there is already text in it, ALL the text
is highlight so if the user want to add something, he overwrites the
existing text if he don't take care..

Question :

Is there a way that when a zoom box opens, the cursor goes all the
time at the end of text ?

thanks


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201002/1

  #3  
Old February 9th, 2010, 07:23 PM posted to microsoft.public.access
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Zoom box end of text

In addition to Ken's answer, I belive that SendKeys is blocked in Vista.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"KenSheridan via AccessMonster.com" u51882@uwe wrote in message
news:a3626c715c429@uwe...
You could remove the highlight by sending a keystroke:

SendKeys "{RIGHT}"
DoCmd.RunCommand acCmdZoomBox

That would leave the text in the zoom box completely unselected, however,
rather than with the insertion point at the end of the text. A better
method
would be to create an unbound dialogue form, frmMemoDlg, with a large text
box, txtMemo on it. In the dialogue form's Open event procedure assign
the
value of the control on the bound form to the text box with:

Dim ctrl As Control

Set ctrl = Me.txtMemo

ctrl = Forms("YourBoundForm").YourMemoControl
ctrl.SetFocus
ctrl.SelLength = 0
ctrl.SelStart = Len(ctrl)

and in its Close event procedure assign the value of the text box back to
the
bound control:

Forms("YourBoundForm").YourMemoControl = Me.txtMemo

You could make the above line conditional on the user confirming the
update
in a message box if you wished.

Then in the double-click event procedure in the bound form open the
dialogue
form:

DoCmd.OpenForm "frmMemoDlg", WindowMode:=acDialog

Ken Sheridan
Stafford, England

jean wrote:
Hi

I have a form containing a memo field; but as there is not enough room
I add vb code on a label and when the user double-click the label zoo
box opens.
DoCmd.RunCommand acCmdZoomBox

But when the box opens, if there is already text in it, ALL the text
is highlight so if the user want to add something, he overwrites the
existing text if he don't take care..

Question :

Is there a way that when a zoom box opens, the cursor goes all the
time at the end of text ?

thanks


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201002/1



  #4  
Old February 9th, 2010, 08:51 PM posted to microsoft.public.access
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Zoom box end of text

Many would say not before time!

Ken Sheridan
Stafford, England

Jeanette Cunningham wrote:
In addition to Ken's answer, I belive that SendKeys is blocked in Vista.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

You could remove the highlight by sending a keystroke:

[quoted text clipped - 54 lines]

thanks


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201002/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 12:42 PM.


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