[AccessD] List box as a status box

Stuart McLachlan stuart at lexacorp.com.pg
Sat Jul 9 16:24:43 CDT 2011


I do this quite frequently.  It works very well for me.

If you just wan to log  events that occuring while the application is running, make the listbox 
source an empty value list and then use something like:

Const cLongMaxListItems
Function Logitem(ev As String) as long
If lstLog.ListCount > clngMaxLogItems Then
   lstLog.RemoveItem 0
End If
   lstLog.AddItem Format$(Now(), "d mmm yy h:nn:ss am/pm") & ";" & ev
End Function

By embedding semicolons in the string "ev", you can use as many columns as you want in 
your list.

If you want the last ten events on record regardless of when they happened, create a query 
qryEventLog: "Select Top 10 * from tblEvents order by evDate DESC",  and make the 
rowsource a query "Select * from qryLogEvent order by evDate"

Then you just need a lstLog.Requery whenever a new record is added.

-- 
Stuart

On 9 Jul 2011 at 10:09, jwcolby wrote:

> I want to put up a control to display a running status, display then
> last N events that occurred.  I have never really liked text boxes for
> this purpose as the last thing displayed as I always seem to end up
> with scrolling issues and so forth.
> 
> I am thinking about using a list control.  This has the advantage (for
> my purposes) of allowing me to have neat columns for the date / time
> and the status to be displayed.
> 
> Does anyone do this and want to comment on how they make it work?
> 
> -- 
> John W. Colby
> www.ColbyConsulting.com
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 






More information about the AccessD mailing list