8/5/2023 0 Comments Private bar access spd' This class displays a progress bar created Private mblnNotSmooth As Boolean ' Display smooth bar by doevents after every update. Private mdteLastUpdate As Date ' Time last updated Private mlblCaption As Access.Label ' progress bar caption Private mlblFront As Access.Label ' label created for front Private mlblBack As Access.Label ' existing label for back Private mobjParent As Object ' parent of back label Private mblnHideCap As Boolean ' display percent complete Private mdblFullWidth As Double ' width of front label at 100% Private mdblVal As Double ' current value of progress bar Private mdblMax As Double ' max value of progress bar Private Const sngOffset As Single = 15 ' For Access ![]() 'Private Const sngOffset As Single = 1.5 ' For Excel The class does the rest.Īnd here is the code for clsLblProg: Option Compare Database Set the back label to the desired size and make the other two hidden. On your form, all you need is three labels. This produces a nice little progress bar: Just drop it into your project in a class module called clsLblProg, and use it like this: I use it all the time in my Access development projects. ![]() In case others might find this useful, here is a class I wrote for this purpose. But you can always show the hour glass this tells the user that something is happening. Possibly you could split the work of your slow query into smaller pieces, in order to get the chance of updating a progress bar. You cannot watch a runnging query in code or the like in Access. Note: Of course you must do the work programmatically for this to work. 'Keep the application responding (optional) SysCmd acSysCmdInitMeter, "working.", rs.RecordCount Rs.MoveLast 'Needed to get the accurate number of records I often do something like this Dim n As Long, db As DAO.Database, rs As DAO.Recordset
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |