Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

Progress Metre

Hi,

I wanted to know how to display a progress metre when a form opens. The form takes a while (unfortunatly) so a indicator to people would be good.

Thanks

Scottsanpedro
0
scottsanpedro
Asked:
scottsanpedro
  • 11
  • 7
  • 3
  • +2
1 Solution
 
RRRCommented:
Hi, scottsanpedro.
You should put progress bar on your top form and use the "value" property of this progress bar like this:

Forms!MyForm!MyPBar.visible = True
Forms!MyForm!MyPBar.value = 0
...................
your code to execute
....................
Forms!MyForm!MyPBar.value = 100
Forms!MyForm!MyPBar.visible = False

You should put the Min and Max properties of this PBar . Min = 0 ; Max = 100. And before all your PBar must be unvisible ( visible = false )

Good Luck
RRR.
0
 
RRRCommented:
PS.
When the code executing you can add some rows like this :
.................................
Forms!MyForm!MyPBar.value = 30
.................................
Forms!MyForm!MyPBar.value = 60
.................................
Forms!MyForm!MyPBar.value = 90
.................................


RRR.


0
 
scottsanpedroAuthor Commented:
RRR,

Thanks for your quick response..

Can you expand your answer a little for me. IE do I use the SysCmd and where to put it. The only command that I'm testing is the openform. Once the form is open the bar disappears. Not too sure where to start...

Thanks

Scott
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
scottsanpedroAuthor Commented:
RRR,

Just using the Active X component.  This is where I shoudl be ..right?

Scott
0
 
RRRCommented:
Yes, that is I mean:
If you opening main form and you want to show to user progress bar, you should create new form that will be popup and modal, borderstyle = none.
On this form you can put ActiveX control and in module monipulate it.
After your form is activete this form will be closed.

Good Luck
RRR.
0
 
scottsanpedroAuthor Commented:
RRR,

I'm obviously doing something wrong..
I've made a popup form.module etc..as you said and placed the Microsoft ProgressBar control on the form.

Then from the click button code to open the other form I place the code as follows..

Dim Form As String
   
    Form = "frmbaseplanMain"
    DoCmd.Echo False
    DoCmd.Close
    DoCmd.OpenForm "frmProgressBar"
    Forms!frmProgressBar!ProgressBar.Value = 0
    DoCmd.OpenForm Form
    DoCmd.Echo True
    Forms!frmProgressBar!ProgressBar.Value = 100
    DoCmd.Close acForm, "frmProgressBar"

The progress bar doesn't even show...

Any clues

Scott
0
 
RRRCommented:
What about this line:

Forms!frmProgressBar!ProgressBar.Visible = True

Put it before this line:
Forms!frmProgressBar!ProgressBar.Value = 0
   
And after this hide PBar back.

TIP:
Don't call any variables like access reserved words (For example: Form, report, Macro, Table, field, Key, Document .....)

Good Luck
RRR.
   

0
 
scottsanpedroAuthor Commented:
Done everything you said...

Maybe something wrong with the ActiveX part. All I get is a box come up but with no action on the progress bar..Doesn't even look like a progress bar.

So I clicked tools then ActiveX controls the registered Microsoft Progressbar Control, Ver 6.0..
 the form I clicked more tools and find the control. Then a blue box appears with vertical lines along. Then re-name the control to ProgressBar...

Run the code from the main form with .visible and .value set to ProgressBar. When the new form finally opens I set the closing of the popup form on the On Open Event.

BUT it doesn't work..anything obvious I'm doing wrong. Haven't really directly used ActiveX control's so maybe going wrong there somewhere.

Thanks for your response

Scott
0
 
RRRCommented:
Hi, scottsanpedro.
You have first to set the PBar's Max and Min properties :
Max = 100
Min = 0

By away , what access do you use 97 or 2000.

Good Luck
RRR.

0
 
scottsanpedroAuthor Commented:
Using Access 97..

The defaults are min=0 and max =100

Scott
0
 
JCECommented:
Hello, scottsanpedro
I have the same problem as you about the ActiveX-control and gave up!
Try this instead, search in Help for the function "SysCmd". There is also a useful example. The progress-bar is visible on the same place as any message on the status-field.

Good Luck!
Christer
0
 
RRRCommented:
Can you send me this file , I will see it and reply you. (Just zipp it) .
OK?
(My e-mail: romans@ipexsoft.com)

RRR.
0
 
scottsanpedroAuthor Commented:
RRR,

There's no way I can send the file as the database is link through ODBC to another SQL Server. Therefore it would take hours to break the link to these recordsets and send a version to you.

I have proved that the ActiveX is working because I ran through a demo from Microsoft in the last 10mins. It's applying this to the form opening I think is the trouble.

I'm presuming you can set a Do Loop that will react to the control. Its finding a way to fit this into the way a form opens..

Am I making sense..

Thanks

Scott
0
 
TemiCommented:
Here's another method:
Try using the acsyscmd function:

dim retval as long
retval = docmd.runcommand: acsyscmdinitmeter(Label as string, MaxValue)

throughout your code, update:
retval = docmd.runcommand acsyscmdupdatemeter(IncrementalValue)

when finished:
retval = docmd.runcommand accmdremovemeter

this posts a status bar at the bottom of your screen.

Good Luck!
0
 
RRRCommented:
Hi, Temi
It is not good idea to mark your solution as answer, you should mark it as comments. If scottsanpedro will find your solution the best solution for this situation , scottsanpedro will ask you to mark it as answer or scottsanpedro can accept your solution as answer.


About status bar.
You may have some users' computers in which the status bar is hiden. :((
 and did you tried your solution???

Hi, scottsanpedro .
Can you paste your code another time. I would like to see it again(after your corrections).

RRR.
0
 
BrianWrenCommented:
Temi,

It is customary in the Access Topic area to post answers as 'Comments,' instead of proposing them as 'Answers.'  This prevents the question from being locked, encouraging more robust exchanges, and avoids making the person who asked the question reject one answer so that they can accept a different one.  

Would you please convert your 'Answer' to a 'Comment?'

scottsanpedro,

I have a popup progress meter that I like a LOT better then the progress bar component.  I'd be willing to e-mail it to you if you'd like.

In this post of yours:
--------------------------------------------------------------------------------

Dim Form As String
     
    Form = "frmbaseplanMain"
    DoCmd.Echo False
    DoCmd.Close
    DoCmd.OpenForm "frmProgressBar"
    Forms!frmProgressBar!ProgressBar.Value = 0
    DoCmd.OpenForm Form
    DoCmd.Echo True
    Forms!frmProgressBar!ProgressBar.Value = 100
    DoCmd.Close acForm, "frmProgressBar"

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

Change to this:

Dim Form As String
     
    Form = "frmbaseplanMain"
    DoCmd.Close
    DoCmd.OpenForm "frmProgressBar"
    Forms!frmProgressBar!ProgressBar.Value = 0
    DoEvents
    DoCmd.OpenForm Form, , , , , acHidden
    Forms!frmProgressBar!ProgressBar.Value = 100
    Forms(Form).Visible = True
    DoCmd.Close acForm, "frmProgressBar"


This won't show any progress taking place though;  it will jump from 0 to 100.

You could use the OnTimer event of "frmProgressBar" to increment the bar.  (Makes it a bit of a clock...)

If there are calculations taking place in code behind "frmbaseplanMain" you could set points that advance the progress bar of the other form...

Brian
0
 
TemiCommented:
My apologies.  I wasn't aware of the protocol.
0
 
TemiCommented:
My apologies.  I wasn't aware of the protocol.
0
 
scottsanpedroAuthor Commented:
Brian,

I would be very grateful of the popup pogress bar. I don't seem to be getting too far up the avenue I'm going at the moment.

I tried the code but has no effect, I get a grey box flash up on screen for 30secs and then disappear and the form opens..scratch head time!!

Thanks for all you answer everyone...So far

Scott
0
 
scottsanpedroAuthor Commented:
Sorry...

It's

Scott_fisher@hotmail.com

Cheers
0
 
BrianWrenCommented:
OK.  It's on the way.

The usage is, in the code you want to keep track of is:

    Meter "<title here>", <optional number here>

The only titles you cannot use are "Close" and "Update"

If the optional number is missing, the progress will be 100% at the value of 100...  Otherwise, the current value is compared aginst the value in the statement above, and % is calculated.


The advance or retreat the progress:

     Meter "Update", <progress>

where progress is some number.

To close the meter:

     Meter "Close"

Questions?

Brian
0
 
scottsanpedroAuthor Commented:
Thanks Brian,

I got the MDB. Unfortuantly I'm off to Scunthorpe (250 miles) today and won't be able to look at this for a couple of days.

Will get back to yu ASAP.

Thanks again

Scott
0
 
scottsanpedroAuthor Commented:
Adjusted points from 75 to 100
0
 
scottsanpedroAuthor Commented:
Brian,

Had a look at the code and looks great. I think that will do the trick. Very kind of you to send it on.

Thanks alot

Scott
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 11
  • 7
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now