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
|
|||
|
|||
Memo Pop-Up
I have a form which is a simple pop-up with 2 fields on it, 1st field is the
prmary key to link to another form, and the 2nd field is just a really big memo box which is used for the user to makes comments and to/do actions on that case. The only other thing is an exit form button. My problem is when the user opens the form, all the text they have already written is highlighted. One-click and they wipe it away by mistake. I want that when they open this form, the cursor is blinking away at the end of the already written text. Am sure it can be done, just need someone to tell me how!!! Any suggestions much appreciated (especially ones that work!) Kirstie |
#2
|
|||
|
|||
Memo Pop-Up
* kirstie adam wrote:
I have a form which is a simple pop-up with 2 fields on it, 1st field is the prmary key to link to another form, and the 2nd field is just a really big memo box which is used for the user to makes comments and to/do actions on that case. The only other thing is an exit form button. My problem is when the user opens the form, all the text they have already written is highlighted. One-click and they wipe it away by mistake. I want that when they open this form, the cursor is blinking away at the end of the already written text. Am sure it can be done, just need someone to tell me how!!! Any suggestions much appreciated (especially ones that work!) Kirstie Kirstie, Try this: Private Sub Form_Current() With Me.tbxMemo .SetFocus .SelStart = Len(.Value) End With End Sub HTH Bob L. |
#3
|
|||
|
|||
Memo Pop-Up
Hi Kirstie,
One effective method is to create a macro using SendKeys and insert {F2}. You might call the macro, “Cursor_RightSide”. When you open a new macro, under Action, use the drop down list and highlight SendKeys. Under Keystrokes at the bottom of the macro screen, enter {F2}, that is F2 with braces. Save and close the macro naming it something like, “Cursor_RightSide” (No quotes). You can make a similar macro for “Cursor_LeftSide” in the event your users enter data at the top, rather than at the bottom of you continuing text in the memo field. Sometimes, too, readers would prefer to see the text at the beginning of the memo rather than at the end. In either case, upon entering the field, the cursor will go immediately to either the end or beginning of the text based on the macro you choose. Note, you will need to enter the field by tabbing into it, rather than using the mouse to insert the pointer (cursor). In the form design view, apply/activate the macro by opening the form’s property sheet (Go to Menu Bar, click View, click Properties), and either clicking on the Events tab or All tab, scroll to the “On Enter” line and type in (or use the drop-down list) the name of your macro (e.g. Cursor_RightSide). Then, when ready to enter data in form view, and tab into the memo field, the cursor will go immediately to the end of your text. In some cases, Microsoft may initially (at the speed of a blink of the eye) highlight the entire text, then instantly go to the end of the text, as you want. Note: The Cursor_LeftSide has keystrokes, {F2}^{Home} Hope this works for you. ------ Tank "kirstie adam" wrote: I have a form which is a simple pop-up with 2 fields on it, 1st field is the prmary key to link to another form, and the 2nd field is just a really big memo box which is used for the user to makes comments and to/do actions on that case. The only other thing is an exit form button. My problem is when the user opens the form, all the text they have already written is highlighted. One-click and they wipe it away by mistake. I want that when they open this form, the cursor is blinking away at the end of the already written text. Am sure it can be done, just need someone to tell me how!!! Any suggestions much appreciated (especially ones that work!) Kirstie |
#4
|
|||
|
|||
Memo Pop-Up
excellent, worked perfectly thanks
"Bob L." wrote in message ... * kirstie adam wrote: I have a form which is a simple pop-up with 2 fields on it, 1st field is the prmary key to link to another form, and the 2nd field is just a really big memo box which is used for the user to makes comments and to/do actions on that case. The only other thing is an exit form button. My problem is when the user opens the form, all the text they have already written is highlighted. One-click and they wipe it away by mistake. I want that when they open this form, the cursor is blinking away at the end of the already written text. Am sure it can be done, just need someone to tell me how!!! Any suggestions much appreciated (especially ones that work!) Kirstie Kirstie, Try this: Private Sub Form_Current() With Me.tbxMemo .SetFocus .SelStart = Len(.Value) End With End Sub HTH Bob L. |
#5
|
|||
|
|||
Memo Pop-Up
Tank,
Genius! worked better than the SelLengh solution Bob (sorry Bob!) gave me as it means i can see all the text when the forms open rather than having to scroll back up, which is good when i just want to read what's there and not necessarily edit the text. Thanks to both of you for your help. Kirstie "Tank" wrote in message ... Hi Kirstie, One effective method is to create a macro using SendKeys and insert {F2}. You might call the macro, "Cursor_RightSide". When you open a new macro, under Action, use the drop down list and highlight SendKeys. Under Keystrokes at the bottom of the macro screen, enter {F2}, that is F2 with braces. Save and close the macro naming it something like, "Cursor_RightSide" (No quotes). You can make a similar macro for "Cursor_LeftSide" in the event your users enter data at the top, rather than at the bottom of you continuing text in the memo field. Sometimes, too, readers would prefer to see the text at the beginning of the memo rather than at the end. In either case, upon entering the field, the cursor will go immediately to either the end or beginning of the text based on the macro you choose. Note, you will need to enter the field by tabbing into it, rather than using the mouse to insert the pointer (cursor). In the form design view, apply/activate the macro by opening the form's property sheet (Go to Menu Bar, click View, click Properties), and either clicking on the Events tab or All tab, scroll to the "On Enter" line and type in (or use the drop-down list) the name of your macro (e.g. Cursor_RightSide). Then, when ready to enter data in form view, and tab into the memo field, the cursor will go immediately to the end of your text. In some cases, Microsoft may initially (at the speed of a blink of the eye) highlight the entire text, then instantly go to the end of the text, as you want. Note: The Cursor_LeftSide has keystrokes, {F2}^{Home} Hope this works for you. ------ Tank "kirstie adam" wrote: I have a form which is a simple pop-up with 2 fields on it, 1st field is the prmary key to link to another form, and the 2nd field is just a really big memo box which is used for the user to makes comments and to/do actions on that case. The only other thing is an exit form button. My problem is when the user opens the form, all the text they have already written is highlighted. One-click and they wipe it away by mistake. I want that when they open this form, the cursor is blinking away at the end of the already written text. Am sure it can be done, just need someone to tell me how!!! Any suggestions much appreciated (especially ones that work!) Kirstie |
#6
|
|||
|
|||
Memo Pop-Up
Don't know how "really big" this memo field usually is, Kirstie, memo fields
can be 65k, but if it passes 32,767 characters the SelStart will throw an overflow error. That's because SelStart's arguement is an Integer. To work around this I use the following: If Not IsNull(MemoBox) Then If Len(MemoBox) 32767 Then MemoBox.SelStart = Len(MemoBox) + 1 Else SendKeys "^{END}" End If End If I don't really like using SENDKEYS, which is why I only invoke it if the memo field is too big to use SelStart, but sometimes you have to. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#7
|
|||
|
|||
Memo Pop-Up
Should have explained, the
SendKeys "^{END}" is the same as keying Control + End. -- 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 | |
|
|