Solved

Progress Metre

Posted on 2000-03-13
24
363 Views
Last Modified: 2011-10-03
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
Comment
Question by:scottsanpedro
  • 11
  • 7
  • 3
  • +2
24 Comments
 
LVL 3

Expert Comment

by:RRR
ID: 2611788
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
 
LVL 3

Expert Comment

by:RRR
ID: 2611793
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2611815
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2611837
RRR,

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

Scott
0
 
LVL 3

Expert Comment

by:RRR
ID: 2611853
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2611937
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
 
LVL 3

Expert Comment

by:RRR
ID: 2611964
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2612556
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
 
LVL 3

Expert Comment

by:RRR
ID: 2612596
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2612629
Using Access 97..

The defaults are min=0 and max =100

Scott
0
 
LVL 1

Expert Comment

by:JCE
ID: 2612646
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
 
LVL 3

Expert Comment

by:RRR
ID: 2612656
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Author Comment

by:scottsanpedro
ID: 2612688
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
 

Expert Comment

by:Temi
ID: 2615451
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
 
LVL 3

Expert Comment

by:RRR
ID: 2615493
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
 
LVL 9

Expert Comment

by:BrianWren
ID: 2616588
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
 

Expert Comment

by:Temi
ID: 2618796
My apologies.  I wasn't aware of the protocol.
0
 

Expert Comment

by:Temi
ID: 2618798
My apologies.  I wasn't aware of the protocol.
0
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2619056
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2619252
Sorry...

It's

Scott_fisher@hotmail.com

Cheers
0
 
LVL 9

Accepted Solution

by:
BrianWren earned 100 total points
ID: 2620168
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2622994
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
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2635601
Adjusted points from 75 to 100
0
 
LVL 1

Author Comment

by:scottsanpedro
ID: 2635602
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

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now