UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Using A Progress Bar, Access 2013    
 
   
SomekindaVB
post Dec 2 2019, 10:15 PM
Post#1



Posts: 322
Joined: 15-December 16



All,

I have a need to implement a progress bar. the problem is, percentages always confuse me, especially when working with larger numbers.

I have a base value of 3090. that is multiplied, through a repetitive process by anywhere from 1 to 50 by a code loop.

During this loop processes are completed. However, I can't work out how to divide this value into a 100 and then represent that on a bar that requires a number from 1 to 100.

So lets say 3090 / 100 = 30.9. in which 30.9 = 1 tick. I'm sure the mod operator should be used, but I don't know how.

Can anyone offer a suggestion with example.

Cheers
Go to the top of the page
 
cheekybuddha
post Dec 3 2019, 05:01 AM
Post#2


UtterAccess Moderator
Posts: 11,907
Joined: 6-December 03
From: Telegraph Hill


What type of progress bar are you using? The built-in ActiveX, or are you creating your own?

Are you saying that 3090 is your maximum value, and your increments each loop are between 1 and 50?

Normally, you would just set the Max, and then increment the value.

If you are rolling your own your progress bar width would be:
CODE
  Me.lblProg.Width = (iProgVal / iMax) * Me.lblProgContainer.Width


If you need to have it as a percentage the formula is:
(value / max) * 100

(where max = 3090)

hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
isladogs
post Dec 3 2019, 06:10 AM
Post#3


UtterAccess VIP
Posts: 1,893
Joined: 4-June 18
From: Somerset, UK


There are many example progress bars available online. Here's one you may be able to use Progress Bar

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
gemmathehusky
post Dec 3 2019, 07:25 AM
Post#4


UtterAccess VIP
Posts: 4,750
Joined: 5-June 07
From: UK


with the access progress bar, you do not have to evaluate percentages.

you just tell it there are 3090 entries for the full progress bar, and then count the records and pass the count to the progress bar.

now for a progress bar, with 3090 entries, there are 100 stages of approximately 30 records per stage - the progress bar won't show a change for multiples below 30/31 records, ie - until the next percentage of the total count is reached - so in point of fact there is no need to update the progress bar unless count mod 30 is zero, especially as updating the progress bar takes quite a few clock ticks - but updating the progress bar for every record is simple to do.

so

CODE
open progressbar 3090
repeat
    increment count
    update progressbar with count
    'or more efficiently
    'if count mod 30 = 0 then update progressbar with count
until done
remove progressbar

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    11th December 2019 - 09:10 AM