
Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
>> Helge
>>
[quoted text clipped - 9 lines]
> tweaking to make the text box scroll to the last item entered, once
> the displayable area has been filled.
The trick is something like this:
txtLog.SelLength = 0
txtLog.SelStart = Len(txtLog.Text)
txtLog.SelText = NewTextString
That automatically scrolls to, and appends to, the end of whatever's already there.
Later... Karl

Signature
Working Without a .NET?
http://classicvb.org/petition
Ron Weiner - 05 Aug 2005 18:38 GMT
Yea - But Access aint VB.
In access before you can touch any of those text box properties you first
have to set focus to the text box so.....
txtLog.setFocus
txtLog.SelLength = 0
txtLog.SelStart = Len(txtLog.Text)
txtLog.SelText = "New text you want to add." & vbcrlf
' Optionally set the focus back to somewhere else
Ron W
www.WorksRite.com
> >> Helge
> >>
[quoted text clipped - 19 lines]
>
> Later... Karl
Karl E. Peterson - 05 Aug 2005 20:53 GMT
> Yea - But Access aint VB.
Oh Yeah? <g>
> In access before you can touch any of those text box properties you
> first have to set focus to the text box so.....
>
> txtLog.setFocus
Okay, whatever... "Some code left to the reader..." <bg>
Thanks... Karl

Signature
Working Without a .NET?
http://classicvb.org/petition
Ron Weiner - 05 Aug 2005 18:44 GMT
Ooooppppsssss....
Actually
Forms!frmLog.txtLog.setFocus
Forms!frmLog.txtLog.SelLength = 0
Forms!frmLog.txtLog.SelStart = Len(txtLog.Text)
Forms!frmLog.txtLog.SelText = "New text you want to add." & vbcrlf
Ron W
www.WorksRite.com
> >> Helge
> >>
[quoted text clipped - 19 lines]
>
> Later... Karl
Dirk Goldgar - 05 Aug 2005 18:54 GMT
>> That's what I would do, too. I have a feeling you may have to do
>> some tweaking to make the text box scroll to the last item entered,
[quoted text clipped - 8 lines]
> That automatically scrolls to, and appends to, the end of whatever's
> already there.
That'll work, so long as the text box has the focus on that form. If
not, you can't reference the .Text or .Sel... properties. I was
interested to discover, though, that the text box doesn't have to have
the application's focus, just the form's focus. That means my worry
about setting focus to the log form was unnecessary. This version works
fine for me:
With Forms!frmLog!txtLog
.Value = (.Value + vbCrLf) & Time & " " & strMessage
.SetFocus
.SelStart = Len(.Text)
End With

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)