Lock scroll position in textbox

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Sorry, but I can't help you there, consider starting a new post with this
question.
Good luck
 
Back
Top