Auto scroll text box?

Atomic Shrimp

Humanoid lifeform
Local time
Today, 10:34
Joined
Jun 16, 2000
Messages
1,954
I've got a form that does a number of file import and processing functions; the users like to be able to 'see' the process happening, so I've added a text box which fills up with an activity log that looks like this:

Started 11/08/00 14:04:05
------------------------------------------------------------------------------------------
14:04:32 g:\customer sales files\PaH\p5wk3.CSV has been selected
14:04:34 Importing p5wk3.CSV - Done
14:04:37 Processing file contents - Done
14:04:40 Records which match the 'discard' list have been removed from the sales data
14:04:40 The file contains 8 days of sales data from 04/08/00 to 11/08/00
14:04:42 The file contains products which are unknown to this system
14:04:52 An error report was printed

etc.

It's fine until the log text reaches the bottom of the text box, but then the user has to scroll down using the scroll bar to see the most recent entry.

What I'd like to do is to have the box scroll automatically so that the newest entry is always visible at the bottom.

Is this possible?

Thanks in advance

Mike
 
Same question

Searching through the forum, this is the only post that I found asking what I was looking for. However it was never replied to.

I figured I'd bring it up again. Any suggestions anyone?

Thanks in advance!
 
Rather than append each new entry to the end of the string, append it to the beginning. That way the notes will be in reverse order with the newest on top.
 
Are you looking for this?
Code:
Me!txtMyTextbox.SelStart = Nz(Len(Me!txtMyTextbox))
Run this code ie 'on focus' of the control.

good luck,
Bert
 
samehkh,

Wouldn't that result in the same problem? A listbox standard starts at the top op the list, so u've still to scroll down to see the last item.
 
I'll be a bit more elaborate on what exactly I'm trying to achieve. I have a form with a subform. The subform contains two textboxes linked to a table (memo and text). The memo-textbox contains a quote. In the timer event of the subform, I've added a procedure to cycle through the records of the subform. Clicking on the subform allows me to add a new quote. Now the problem is that the quote I add is sometimes longer than the provided textbox. What I would like to do now, is have the text autoscrolled slowly and repeatedly (so that the text doesn't stop at the end, but restarts at the beginning when the end is reached).

Since I'm pretty much a layman at VBA, I have been unable to achieve that. But I hope I'll get there with the infinite knowledge of everybody on this forum.

Thanks.
 
Thank you. I'll see what I can do with it.

I'll be back.
 
Unfortunately I have been unable to convert the previous suggestion into a working solution. I'll keep trying. Meanwhile, any other suggestions are very welcome.

Thanks.
 
My suggestion was originally for Mike's problem. I am not sure if thid will help, but if you are using a listbox, you can scroll through it up and down using code like:

Static ScrollSt As String

...Loop start

Me.MyList.AddItem YourItem
ScrollSt = ScrollSt + "{DOWN}"
Me.MyList.SetFocus
SendKeys ScrollSt

....Loop end
 

Users who are viewing this thread

Back
Top Bottom