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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|