Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Jun 2007
    Posts
    40

    Unanswered: Progress Indicator

    I have a "Please Wait" form while a large amount of data is being committed to the database. The form contains the actual commit code, in the Form_Current event. I want it to display information on what it is doing, while it is doing it, e.g.
    Code:
    lblCurrentAction.Caption = "Now adding employees."
    However instead, once the button to activate the form is clicked, "Calculating..." shows in the status bar, and the form is only displayed once the last action has been completed, and shows that the last action has indeed been completed in the lblCurrentAction label.

    In addition, once the processing is over, I want to close this "Please Wait" form, however according to the error message I get, I can't close a form during one of its own events.

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    You might want to try a refresh. Else, I use this progress meter on some of my apps.
    Me.Geek = True

  3. #3
    Join Date
    Jun 2007
    Posts
    40
    Quote Originally Posted by nckdryr
    You might want to try a refresh. Else, I use this progress meter on some of my apps.
    I really would like to have a "text" progress meter rather than a tiny little bar in the status bar, especially since there are many queries running here and not just one.

    What do you mean by a "refresh"? Which event would I run this in?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you are running a series of queries you are very restricted on what you can do in terms of user feedback. A progress meter is fine, but you need to know the number of events to be monitored to make any use of it, which you dont always know in advance.

    you can run your queries as a recordset and set the progress memter as you iterate through the recordset.. not clever as it will take significantly longer.

    you could run your queries as a process within a form, and display a suitable text message as each query completes

    eg
    ...about to process <query blah>, should take <blah> minutes...
    ...done, nnn records processed,yyy records rejected.....
    remember to do a do events between each query.. to make sure the form will repaint in between
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2007
    Posts
    40
    Quote Originally Posted by healdem
    if you are running a series of queries you are very restricted on what you can do in terms of user feedback. A progress meter is fine, but you need to know the number of events to be monitored to make any use of it, which you dont always know in advance.

    you can run your queries as a recordset and set the progress memter as you iterate through the recordset.. not clever as it will take significantly longer.

    you could run your queries as a process within a form, and display a suitable text message as each query completes

    eg
    ...about to process <query blah>, should take <blah> minutes...
    ...done, nnn records processed,yyy records rejected.....
    remember to do a do events between each query.. to make sure the form will repaint in between
    I know exactly what indicators I am going to display - this is not my problem. The problem is displaying them. I don't want to set a progress meter. "run your queries as a process within a form" - yes, this is exactly what I want to do, but how?

  6. #6
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by kidburla
    I have a "Please Wait" form while a large amount of data is being committed to the database. The form contains the actual commit code, in the Form_Current event. I want it to display information on what it is doing, while it is doing it, e.g.
    Code:
    lblCurrentAction.Caption = "Now adding employees."
    However instead, once the button to activate the form is clicked, "Calculating..." shows in the status bar, and the form is only displayed once the last action has been completed, and shows that the last action has indeed been completed in the lblCurrentAction label.
    after you set the label, do a me.Repaint on the form (or is it the Refresh action... try them both and see which works).
    Me.Geek = True

  7. #7
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Can you run ado queries asynchronously from within Access? (You can from VB6 by declaring them WithEvents.) If you can, then you can use the recordset fetchprogress event to display the progress textually.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I searched for good progress meter code for quite a while and the only progress bar meters I could find were ones where you had to supply it with the percentage variables (I could not find any which utilized Microsoft's progress bar which is never accurate anyway.) I use the progress bar for when I walk through records in a recordset supplying it with the count of which record I'm on and the overall count (if there are others, please post them but I have yet to find any).

    In regards to updating the progress screen, I had to issue a Forms!MyProgressMeterForm.repaint command.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Jun 2007
    Posts
    40
    Yes, the repaint method would work, but that is not my problem, my problem is getting the progress indicator to come up in the first place!

  10. #10
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by kidburla
    Yes, the repaint method would work, but that is not my problem, my problem is getting the progress indicator to come up in the first place!
    By "progress indicator", do you mean your form? If so, have you tried a repaint instead of a refresh? Are you using echo?

    EDIT:
    Maybe it would help if you posted what code you were doing as well.
    Me.Geek = True

  11. #11
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I typically use SysCmd to display such messages in the status bar. Adding DoEvents may solve your problem, but I've found it slows down processes, so I use SysCmd.
    Paul

  12. #12
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Sounds like it should be done asynchronously...why would you want to have the user just sit there?

    Or is this some admin function.

    What does this load do, and what's the data for, andf what's the source?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  13. #13
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    This sounds like a problem I was having with a form I was using for user feedback. The processing starts but the form never appears, correct? If so, you might want to move your code to the On Timer event. Set the Timer Interval to 1 second or so. Then in the On Timer Event start by setting the interval to 0 and then begin the processing. This should allow the form to display completely and all the advice you have gotten (Repaint, Refrssh, etc.) should work.

  14. #14
    Join Date
    Jun 2007
    Posts
    40
    Quote Originally Posted by DCKunkle
    This sounds like a problem I was having with a form I was using for user feedback. The processing starts but the form never appears, correct? If so, you might want to move your code to the On Timer event. Set the Timer Interval to 1 second or so. Then in the On Timer Event start by setting the interval to 0 and then begin the processing. This should allow the form to display completely and all the advice you have gotten (Repaint, Refrssh, etc.) should work.
    Yes, this sounds like a very good idea. I will try it when I get back to work tomorrow morning.

  15. #15
    Join Date
    Jun 2007
    Posts
    40
    Quote Originally Posted by DCKunkle
    This sounds like a problem I was having with a form I was using for user feedback. The processing starts but the form never appears, correct? If so, you might want to move your code to the On Timer event. Set the Timer Interval to 1 second or so. Then in the On Timer Event start by setting the interval to 0 and then begin the processing. This should allow the form to display completely and all the advice you have gotten (Repaint, Refrssh, etc.) should work.
    Thanks very much, this worked perfectly and was exactly what I needed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •