Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150

    How to use progress bar

    ruralguy, I am here again. Can you help me how to use progress bar.

    for example, I am exporting data from query to excel. I want to start the progress bar as the exporting starts and end the progress bar as the exporting ends.



    if it is possible, please give me an attached example for that...thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Without some break in the code there is no place to update a ProgressBar. What command are you using for the export to Excel?

  3. #3
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    I am using docmd.outputto?

    can you show me some coding how to insert the progressbar starting and ending while exporting the data?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sorry Marianne but as I said, without a logical break in the code there is no way to make the ProgressBar work. The maching is tied up with your DoCmd.OutPutTo and all that would happen is the ProgressBar would show initialized and then when the DoCmd operation was done the ProgressBar would show complete. Not mush use really. How long does the operation take?

  5. #5
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    i'm sorry but what do you mean about logical break?

    and if this will not work, any suggestion how can I still use the progressbar so as to show the progress to exporting?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How long does the operation take? Maybe no visual indication is needed.

  7. #7
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    maybe 5 minutes to 15.

    any suggestion how can I still use the progressbar so as to show the progress to exporting?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Wow, that is certainly too long to go without some indication from the computer that it is still alive. Is this all on the same machine or is it using a network. How big is the export query? You may need to resort to using a RecordSet just so you can update a ProgressBar.

  9. #9
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    this is on the same machine. i cant remember how many records now but it takes really long to export.

    Resort to recordset? How to? can you show me please how to to that?

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I have not as yet used DoCmd.OutPutTo so I need to do a little research before answering.

  11. #11
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    How about you ruralguy, how do you export aside from using docmd.outputto?

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Marianne,
    Do me a favor and post the complete exact line where you use DoCmd.OptPutTo...including all of the arguments.

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by marianne View Post
    How about you ruralguy, how do you export aside from using docmd.outputto?
    I have not had a need to yet. That's why this is taking some research on my part.

  14. #14
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    Private Sub exporting_click()
    docmd.OutputTo acOutputQuery ,"Accounts",acformatxls,"C:\Account.xls",true
    End Sub

    this is as simple as it can get. I am just wondering where to insert the progressbar coding.

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is it necessary to load Excel while this operation is going on as you are doing?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums