473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Please Tell Me about the Progress Bar

22
Original title :
Thanks Rabbit and ZMBD, Please Tell me about progress bar

I solved my last issues Thanks. I started again I think I was trying too much and got too bogged down, so started again and kept it tidy and clean.

I would like to know about a progress bar. I have a parameter form with a button that you click and opens a report but the report takes a while to do all the calculations as there is a lot. You can see the report while it is doing this. I would like to put something on the screen to show progress or that the system is doing something.

I dont want to just change the mouse pointer to an egg timer but would like a bar thing. I tried an ActiveX control but it did not show up on the report only in design view. I am not sure where to put it in the form under the button or on the report. I dont know weather the ActiveX one is best or VBA code(I try and find the code on line and copy and paste it). I am not sure if I make my own box and code that or put it in the report load event.

I like the idea and would like to learn/use it. I am not that good with VBA but do give things a try. Can someone tell me about the progrss bar(Access 2007).
Nov 6 '13 #1
7 2463
NeoPa
32,556 Expert Mod 16PB
That's a nice concept Wornout, but we have standards that titles must conform to. I've updated it for you and put the thanks in your opening post instead.

There are a number of threads on Bytes that deal with this issue :
How to Use a Progress Meter in Access.
Progress Indicator in Access.

These are just two. Look them over and see which more closely fits your requirements then we can discuss how to help you if you need more help.
Nov 6 '13 #2
topher23
234 Expert 100+
I've used the ActiveX progress bar in the past and found it to be useful, but it's a dependency that's unnecessary; it provides no actual additions to functionality. Instead, you could try something like this:

Add a rectangular Box the size of the progress bar you want to see on the form you'd like it to appear on. We'll name this box boxProgressBarFrame. Give it a solid border and a transparent background. Then throw another box directly over this box, with either a transparent border or a border the same color as the frame, and a solid background. Name this box boxProgressBar. If you want to display a little message, like "Loading the report...", create a label with your text and call it lblProgressBar. Then use a function like this:

Expand|Select|Wrap|Line Numbers
  1. Public Function pfnProgressBar(ProgressPercent As Integer)
  2. 'Code courtesy of Topher Ritchie
  3. 'Free to use as part of an application
  4. 'if this notice is left in place.
  5. Dim ControlSize As Long
  6.  
  7.     ControlSize = 2 * 1440 'The progress bar is 2 inches on   
  8.                            'screen, multiplied by 1440 to get  
  9.                            'the number of "twips," the 
  10.                            'actual measurement unit used by 
  11.                            'MS Access
  12.     With Forms!MyForm 'change this to your form name
  13.         If ProgressPercent = 0 Then 
  14.             !lblProgressBar.Visible = False
  15.             !boxProgressBar.Visible = False
  16.             !boxProgressBarFrame.Visible = False
  17.         Else
  18.             !lblProgressBar.Visible = True
  19.             !boxProgressBar.Visible = True
  20.             !boxProgressBarFrame.Visible = True
  21.         End If
  22.         If ProgressPercent > 100 Then ProgressPercent = 100
  23.         !boxProgressBar.Width = (ProgressPercent / 100) * _
  24.               ControlSize
  25.         .Repaint
  26.     End With
  27.  
  28. End Function
  29.  
So, you pass a "percentage" number like so:
Expand|Select|Wrap|Line Numbers
  1. pfnProgressBar 20
and the progress bar moves to 20% completion. Obviously, this means you have to trap events and iterate your progress, so when the code is running it will keep updating. Passing
Expand|Select|Wrap|Line Numbers
  1. pfnProgressBar 0
will make the progress bar and label invisible to the user.

Let us know if this will work for you.
Nov 6 '13 #3
Wornout
22
Thanks NeoPa, I did not realize, I did do a search on here but did not really understand what I was meant to be doing and if it was even a good idea.Maybe cause it was getting late and my mind was getting tired and I was having trouble formatting some equations in a union query and getting frustrated with that.
Nov 6 '13 #4
Wornout
22
Thank you Topher23 will give it a try,and let you know
Nov 6 '13 #5
NeoPa
32,556 Expert Mod 16PB
Doing a search, and finding what you want, are not always the same thing. No criticism implied because you don't have the tools available to you that I do. I keep notes of many of what I consider the most important and useful threads and posts. These are just two that I have in my database for whenever such questions come up.
Nov 7 '13 #6
Wornout
22
Hi Topher23, I did as you said and copied and pasted what you wrote and changed the form to report name of report. but got lost when you said "So, you pass a "percentage" number like so: pfnProgressBar 20". The above code is not in an event attached to anything,I just opened my report in design view and up the top on the tool bar next to properties sheet I clicked on the VBA code symbol and put it there is that right?now I can at last see the bar but it does not move while the calculating is being done is that because I have not passed the % I am not sure where that goes or how,
Nov 8 '13 #7
NeoPa
32,556 Expert Mod 16PB
From time to time, in your code, you call it with different percentage values. Whatever value was passed last time you called it - will be what is displayed in the progress meter. Does that make it clearer for you?
Nov 8 '13 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gabriel Mejía | last post by:
I can replicate the crashes of my web site, and that is when I run a desktop visual basic application. this apllication works fine but has a long transaction that blocks the sql database. After...
2
by: Alexander Stippler | last post by:
Hi, what about "not a number"? What does the standard enforce, what not? I read in the C standard, that NAN is defined if and only if the implementation supports quiet NaNs for the float type....
1
by: pvenkatesh2k4 | last post by:
hai friends tell any websites for teachs the graphics functions
4
by: aj | last post by:
Alan, you can achieve this by using XMLHttp Async functionality in a javascript file. Create an aspx page in which execute long running SQL query, then do an XMLhttp post to that page from a js...
2
by: Nikolay Petrov | last post by:
In many examples about progress bars i've seen that a loop is used to change the progress bar value. What if I want to show a progress bar for an operation that does not have loops? Like...
6
by: Marty | last post by:
Hi, I would like to know if the VB.NET compiler could tell about not used variable? If yes, How do I set it? Or at least display a warning like in c++. Thanks you Marty
0
by: Adam Byrne | last post by:
Been wondering about this... Which is better? (pseudocode - please don't grill me about semantics etc.) public class Thing { public void DoLongOperation(IProgressCallback callback) { for (int...
2
by: mahesr | last post by:
hi all, am just stating to use joomla cotent mgmt tool.and am want to creat a new component myself.any one give idea about cration of componet or give a good link easy to understand. ...
1
by: sheetalsuthar | last post by:
Can any one tell about the solution of networking where hacker cannot attacked, no hard disk needed ,no Microsoft OS needed, cost saving for network up to 400 pc?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.