Popform as indicator

JohnPapa

Registered User.
Local time
Today, 20:35
Joined
Aug 15, 2010
Messages
1,117
Popup form as indicator

Is it possible to have a popup form indicate the progress of activity that takes place on an underlying form? When I click on a specific button on the underlying form, I would like a popup form appear and inform the user of the activity that takes place in the underlying form. In the simplest case the popup form would display a static caption such as "Working ..." and if possible it would be nice to be able elapsed time etc. The popup form should disappear (or made invisible) when the code in the underlying form finishes. The dimensions of the popup form should be user-defined.
Thanks,
John
 
Last edited:
Is it possible to have a popup form indicate the progress of activity that takes place on an underlying form? When I click on a specific button on the underlying form, I would like a popup form appear and inform the user of the activity that takes place in the underlying form. In the simplest case the popup form would display a static caption such as "Working ..." and if possible it would be nice to be able elapsed time etc. The popup form should disappear (or made invisible) when the code in the underlying form finishes. The dimensions of the popup form should be user-defined.
Thanks,
John

What you are asking for as far as I know is possible, but would have to be completely written by you. I have written one, but it is not easy to cut and copy it for you.

I created a form as a popup with no borders or close options. I have a revolving animated gif file on it and a label at the bottom. The form has a public function wich accepts text and this text goes onto the label.

Basically when you have a long process you would need to do something like this

1. process wanted by user
2. start your waiting form - make it on top - show a message or % complete (you would need to calculate your %)

3. do a part of your process
4. update your form with messages or updates to % complete

5. repeat 3 / 4 till finished.

The main problem you are going to face is that Access is not multithreaded, so if you have some CPU intensive process happening, then your waiting form is not going to update. The DoEvents command can help provided you are able to use it.

For example I have a SQL query which opens a recordset. When i issue the method to OPEN it, basically Access is dead for 30 seconds and I cannot update my waiting form until the OPEN is finished.

I hope this gets you started.
 
the hard thing is monitoring a query

if you are running, say 12 queries, then it is easy to have a 12-step progress bar. However if one of these is a "long" query - you cannot "break into" this to show the progress of this one.

access will have its own progress bar at the bottom left, which will show during the long query, and you can show the hourglass - but once the long query starts, its on its own!
 
Popup form as indicator

Darbid,
Thanks for the comments. Some of the issues addressed appear in an earlier thread called "Progress Indicator Wanted".

In its simplest form I would like the popup to contain only a verbal indication that processing is being carried out, while the underlying form continues to execute the code.

I have a few questions:
1) How do I open the popup form. I do not seem to be able to resize using Movesize if I do not open with acDialog. If I do open with acDialog then processing continues only when the popup closes.
2) Does your popup form appear on top of the underlying form, while the code executes in the underlying form?
3) If it is possible to email something I can provide my email address.

I agree that for CPU intensive processes, Access will go for an electronic tea break and no update takes place and DoEvents will help very little.
John
 
Last edited:
Gemma-the-Husky,

The Hourglass is a possibility, but would like something a bit more visible.

John
 
I will give you an example if i can cut it out.
 
here you go. See Picture for what it looks like.

For ease I have just cut and copied till I did not get an error. I notice a shadow does not work properly when text is injected but that is only a small issue.

In the zip folder I have included the gif file I made and the .dll you will need to make it work. If you do not want this then just deleted it and remove the reference from the example.

Otherwise just register the .dll in your system32 folder and you can use it like I have.

edit: Removing all the API stuff I have added makes it a little easier to handle but I like a semitransparent, round form - with a shadow ....
 

Attachments

  • New Folder.zip
    New Folder.zip
    77.3 KB · Views: 111
  • New Picture.jpg
    New Picture.jpg
    30.6 KB · Views: 105
Thanks Darbid,
It looks very nice, but I would rather not use dll's to avoid complications, with specific user configurations.
I am just returning to my earlier question, since Access cannot handle multiple threads, is it possible to open a form (on top of an underlying form) which merely has a label on it saying "Processing..." while the underlying form executes code?
 
Thanks Darbid,
It looks very nice, but I would rather not use dll's to avoid complications, with specific user configurations.
I am just returning to my earlier question, since Access cannot handle multiple threads, is it possible to open a form (on top of an underlying form) which merely has a label on it saying "Processing..." while the underlying form executes code?

YES - open my example - you will get warning messages of missing references.

1. delete the control from the form
2. you might have to comment out one or two lines of code referring to the control.
3. remove a reference.
4. Understand my size changes. Or remove them and just make it a conrtant size.

You are done.
 
Darbid,
Many thanks, it seems to be working. I merely commented out the 2 calls to the gif.
John
 
Darbid,

I integrated the code you posted on this thread in my application and it is looks very good.

It works fine. I would like to thank you once more for your help.

John
 
Darbid,

I integrated the code you posted on this thread in my application and it is looks very good.

It works fine. I would like to thank you once more for your help.

John

No Problem. I am really glad that you find my ideas or work usefull.

If you have kept everything other than the animated gif you are probably going to see a few problems if Access hogs your CPU during what ever process you are also running. Sometimes after putting this small form up if I execute a SQL or do something else that takes a while this form will "unpaint" itself. ie the corners will go and the window is painted square. You will notice that I tried to make the form do a Doevents with the timer, but once again Access is really not a multithreader so this does not work all the time.
 
Indeed I experienced the unpaint effect you mention and I solved it by moving the command that updates the label to a different position.

Is there a fullproof way around this or is it something you have to live with?
 
Is there a fullproof way around this or is it something you have to live with?

1. take out the Windows API stuff that plays with the shape of the form.
2. create your own VB6 or VB.net program that does this form for you.

I have no idea why this happens, I think that because we are changing its shape Access has to keep updating this form. "updating" means in Windows sending messages to the form to keep it looking like it is. Because access cannot multithread this process of updating stalls. This is the reason why 2 will work. If another program is doing it then it should use a different thread.
 

Users who are viewing this thread

Back
Top Bottom