I have a query running in Microsoft Access 2010 and it takes over 30 min to run normally. I would like to present the end user with some status of the query. A progress bar would be nice but not required. Final Uninstaller 2.6.9 Serial Number more. Access seems to be poorly threaded and locks up tight during the execution of the query negating any updates I try. While I'd rather whip out VS and write my own app to do this I'm forced to use Access. EDIT I used to run this from a batch script which populated the database but I'd like to have it all self contained in Access.
To be specific the 'query' is really a VBA script that pings a series of hosts. So I'm not to concerned about optimizing the time per se but simply to let the end user know it hasn't locked up. I often do something like this Dim n As Long, db As DAO.Database, rs As DAO.Recordset 'Show the hour glass DoCmd.Hourglass True Set db = CurrentDb Set rs = db.OpenRecordset('SELECT.' ) rs.MoveLast 'Needed to get the accurate number of records 'Show the progress bar SysCmd acSysCmdInitMeter, 'working.' , rs.RecordCount rs.MoveFirst Do Until rs.EOF 'Do the work here. 'Update the progress bar n = n + 1 SysCmd acSysCmdUpdateMeter, n 'Keep the application responding (optional) DoEvents rs.MoveNext Loop rs.Close: Set rs = Nothing db.Close: Set db = Nothing 'Remove the progress bar SysCmd acSysCmdRemoveMeter 'Show the normal cursor again DoCmd.Hourglass False Note: Of course you must do the work programmatically for this to work. You cannot watch a runnging query in code or the like in Access.
Possibly you could split the work of your slow query into smaller pieces, in order to get the chance of updating a progress bar. But you can always show the hour glass; this tells the user that something is happening. In case others might find this useful, here is a class I wrote for this purpose. I use it all the time in my Access development projects. Just drop it into your project in a class module called clsLblProg, and use it like this: This produces a nice little progress bar: On your form, all you need is three labels.
Create a Timed Progress Bar in MS Access. Microsoft Access / VBA Forums on Bytes. Jun 11, 2017 Office VBA Reference Access VBA Use the Status Bar Progress. In Microsoft Access. Create a progress meter on the status bar that gives a. Feb 01, 2008 Hi, I have a progress bar on my form which I have setup my using; Public pgBar As MSComctlLib.ProgressBar When my form is. How to show progress on status bar when running a sequence of queries in MS. (How to show progress on status bar. Browse other questions tagged access-vba ms.
Set the back label to the desired size and make the other two hidden. The class does the rest.
Due to problems with available control I created a home grown progress bar using 2 rectangles. A border, and solid bar that is resized as things progress. The progress rectangle in in front of the border. To use If pbar Is Nothing Then Set pbar = New pBar_sub pbar.init Me.Progressbar_border, Me.ProgressBar_Bar End If pbar.value = 0 pbar. Gps Underground How To Install Maps On Garmin here. show pbar.max = 145 ' number of interations. Do While Not recset.EOF count = count + 1 pbar.value = count ' get next recset.MoveNext Loop One can associate a status line with the progress bar that announces what element is being processed. This is not a professional way but can be applied if you like it. If you are using a form You can have a small text box in a convenient place default with Green color.
Supposing the text box Name is TxtProcessing, Properties can be as below. Name: TxtProcessing Visible: Yes Back color: Green Locked: Yes Enter Key Behavior: Default 1) In your VB script you can put Me.TxtProcessing.BackColor = vbRed which will be in Red and it signifies the task in Process. 2) you can write all your set of scripts 3) At last you can put Me.TxtProcessing.BackColor = vbGreen Me.TxtProcessing.BackColor = vbRed Me.TxtProcessing.SetFocus Me.Refresh Your Code here.
Me.TxtProcessing.BackColor = vbGreen Me.TxtProcessing.SetFocus:-) Funny but purpose is achieved.
I have developed several applications in code which take anywhere from 15-30 minutes to run, depending on the amount of data and local server traffic. I would like my clients to be able to tell that their process is actually running through some kind of 'percentage complete' status bar or progress indicator, rather than their computer sitting there with an hourglass visible for what seems like forever. I would like to set this up where it runs from the form which triggers the code or the like.any easy way to set this up or any code repository make this easier?