Lock scroll position in textbox

G

Guest

I have a memo field that the user can scroll through, however if they leave
the field and come back the scroll position is reset to the top. Is there
any way to lock the scroll position for a textbox through code?

Thanks in advance!!

Jerry
 
G

Guest

Try and creating a variable, saving the location of the cursor as you leave
the field, and then when the focus is back to the field, set the location
again

Option Compare Database
Dim MyLocation As Long

Private Sub FieldName_GotFocus()
Me.FieldName.SelStart = MyLocation
End Sub

Private Sub FieldName_LostFocus()
MyLocation = Me.FieldName.SelStart
End Sub
 
G

Guest

Ofer,

Thanks - This works well for remembering the location once I exit and
re-enter the field, however I also would like the field to stay at the same
scroll point even when I exit it, right now the scroll bar automatically
resets to the top of the field if I click another field on my form. Any
suggestions on how to "lock" the scroll bar in a specfic position?

Thanks for the help - The code you supplied worked great!
Jerry
 
G

Guest

Sorry, but I can't help you there, consider starting a new post with this
question.
Good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top