How does one get the cursor in a memo field to default to the beginning of that memo field in front of the first letter of text?
Thanks, Roy.
Access 2007 Memo field
-
- Administrator
- Posts: 78229
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Access 2007 Memo field
If you mean a memo field in a table or query, there is no way to do that for one field specifically. It's governed by the "Behavior entering field" option, but that is an application-wide, user-level setting (it does not travel with the database).
On a form, you can use the On Enter event of the text box bound to the memo field. For example, for a text box named memNotes:
This will work when the user tabs into the text box. When the user clicks in the text box, the insertion point will be where the user clicks.
On a form, you can use the On Enter event of the text box bound to the memo field. For example, for a text box named memNotes:
Code: Select all
Private Sub memNotes_Enter()
With Me.memNotes
.SelStart = 0
.SelLength = 0
End With
End Sub
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 70
- Joined: 24 Dec 2012, 20:26
Re: Access 2007 Memo field
Thank you very much Hans. It is for a form not a table.
Much obliged, Roy.
Much obliged, Roy.
-
- 4StarLounger
- Posts: 495
- Joined: 13 Sep 2013, 07:56
Re: Access 2007 Memo field
Using Code:royfarnol wrote:How does one get the cursor in a memo field to default to the beginning of that memo field in front of the first letter of text?
Thanks, Roy.
To put the cursor at the start regardless of where the user clicked on the control, you could use:
Code: Select all
Private Sub PersonNote_GotFocus()
Me!PersonNote.SelLength = 0
Me!PersonNote.SelStart = 0
End Sub
Code: Select all
Private Sub NotifiedByEmail_Click()
Me!NotifiedEmailAddress.SetFocus
Me!NotifiedEmailAddress.SelStart = 0
Me!NotifiedEmailAddress.SelLength = 50
End Sub
Regards, Ben
"Science is the belief in the ignorance of the experts."
- Richard Feynman
"Science is the belief in the ignorance of the experts."
- Richard Feynman
-
- StarLounger
- Posts: 70
- Joined: 24 Dec 2012, 20:26
Re: Access 2007 Memo field
Thanks Ben.