Splash screen/Dashboard Progress bar

aman

Registered User.
Local time
Today, 01:03
Joined
Oct 16, 2008
Messages
1,251
Hi All

I want a progress bar in a form that will increase from bottom to top . The data will from Access table. The bar will start from 0 to Maxvalue. The Maxvalue will be calculated as below:

Total number of batches in the table/ No. of working days between 14072014 and 31112014 / 2

So the above calculation will define the range of a progress indicator.

And now we have to show the % percentage that means how many batches have been scanned for today. For this the following calculations will be used:

Count total batches where scandate=today and scannedby<>null

Now this will show the percentage in the bar that means hopw much work has been completed.

The progress bar should move from bottom to top when % increases.

Thanks
 
The simplest way to do this is to have two box controls. The first one, we'll call BackBar, should be placed on your form to create a vertical bar. The height doesn't really matter but it's total height represents 100% of maxvalue.

Now place the second box control (we'll call it ProgressBar) over the Back Bar, lined up at the bottom and narrower than the BackBar.

So when you do your calculation, you will be calculating the height of the ProgressBar as a percentage of the height of the BackBar and adiusting the top of the ProgressBar accordingly.

so if your maxvalue =1000 and your progress is 300 then the code would be something like

Code:
progressbar.move progressbar.left, backbar.top+backbar.height-backbar.height/maxvalue*progress, progressbar.width, backbar.height/maxvalue*progress
see this link on .move

http://msdn.microsoft.com/en-us/library/office/ff837237(v=office.15).aspx

If you require further help, please clarify the following

when you say the progress bar should move, do you mean it moved up the form but stays the same size or do you mean it increases in height (which is my assumption above)?

can you clarify what this means

Total number of batches in the table/ No. of working days between 14072014 and 31112014 / 2
What is a batch? is it a single record? Is 14072014 a date or a number? Please provide an example of the values and the final result.
 
Thanks CJ_London

below are the answers to the questions you were not sure about:

when you say the progress bar should move, do you mean it moved up the form but stays the same size or do you mean it increases in height (which is my assumption above)?


That means it should increase in height. Thanks. e.g when its 0% then nothing will show up in the project bar bu as the percentage increases the bar increases in height from bottom to top.


can you clarify what this means


Quote:
Total number of batches in the table/ No. of working days between 14072014 and 31112014 / 2

The above is used to determine the max range of a progress bar. my manager gave me the above formula to use it in the code. So we will keep that.
Yes batch is a single record. In the table the fields are batchno,scandate,scannedby etc. we have to find out the total working daye between 14/07/2014 and 31/11/2014. It could be a date or number .

so one value will be "Total number of batches in the table/ No. of working days between 14072014 and 31112014 / 2 "

Code:
count(*) from table1/No. of working days between those two dates/2

The other value will be "Number of batches scanned in a day" which will increase the bar in height. something like below:

Code:
count(*) from tabl1 where scandate=today and scannedby<>null

So based upon those two values the progress bar changes.

Please let me know if anything is unclear. Thanks.
 
So which bit do you now need help with?

Total number of batches in the table
DCount("*","myTable")

No. of working days between 14072014 and 31112014
Simplistically it is DateDiff("d",#07/14/2014#,#12/31/2014#) (I presume you mean Dec, not Nov) but you need to define working days more clearly - do you work Mon-Fri or weekends as well? What about shutdowns and bank holidays? Is working days the number of days the business is open or some other factor? e.g. business is open 7 days but warehouse is open 5 days)

Count total batches where scandate=today and scannedby<>null

DCount("*","scanTable","[ScanDate]=" & date() & " AND [Scannedby] is not Null")

 
CJ_London

I need help to change the progress bar as the value changes. So changing the height of progress bar. So suppose working days are 90.

A=DCount("*","myTable")/90/2

B=DCount("*","scanTable","[ScanDate]=" & date() & " AND [Scannedby] is not Null")

call Progress(A,B)

Now what should I write in this function??

Many Thanks
 
The code per my original post

progressbar.move progressbar.left, backbar.top+backbar.height-backbar.height/maxvalue*progress, progressbar.width, backbar.height/maxvalue*progress

MaxValue is the equivalent of your A and progress is the equivalent of your B

For this code to work in your Progress sub, the sub needs to be in your form module and is probably called from your form load or current event
 

Users who are viewing this thread

Back
Top Bottom