Editing Logging Activities to a Text Box
Jump to:
navigation
,
search
To log activities (especially during long-running tasks), create a text box and call "LogAction" to update with text. * Create Text Box: ** Make Multi-Line ** Drag to cover large area of form (expand form as necessary) ** Change Anchor to include bottom and right ** Change name to tbLogInfo ** Add Scrollbars ** Make Read-Only ** Make Word-Wrap = False * Add this sub: Sub LogAction(ByVal TheText As String) tbLogInfo.Text &= Format(Now, "hh:mm:ss tt") & " " & TheText & vbCrLf tbLogInfo.Select(tbLogInfo.TextLength, 1) tbLogInfo.ScrollToCaret() Application.DoEvents() End Sub This sub appends the text, add CR/LF, and scrolls to the end. The Application.DoEvents gives Windows a time to catch up on screen paints. * Call with: LogAction("Unknown: " & Acct_Rec.AccountName & " (" & Acct_Rec.RowState & ")")
|
Editing help
Personal tools
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
Actions
Search
Navigation
Main page
Community portal
Current events
Recent changes
Random page
Help
Toolbox
What links here
Related changes
Special pages