By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Using progress Bar

abouddan
P: 42
Hi all
I have an access2000 database and I am trying to use a progress bar in a form.
What I need is the following:

In a form let's call it 'form1' I have a command button 'Command1' that opens a report 'Report1'. How can I use the progress bar that shows the real time needed to open the report?
Mar 2 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,315
At the beginning of the code for the command button click, store the time. Then at the end, compare it to the time using DateDiff.
Mar 2 '07 #2

ADezii
Expert 5K+
P: 8,597
Hi all
I have an access2000 database and I am trying to use a progress bar in a form.
What I need is the following:

In a form let's call it 'form1' I have a command button 'Command1' that opens a report 'Report1'. How can I use the progress bar that shows the real time needed to open the report?
Here is a Basic Template for the use of a Progress Bar. It loops through a Recordset and Updates the Progress Bar accordingly. If you need any further assistance or explanation as to how this code functions, feel free to ask. First of all:
__1 Insert ==> ActiveX Control ==> Microsoft ProgresssBar Control
__2 Position & Resize Control as needed.
__3 Rename Control to ProgressBar1

Expand|Select|Wrap|Line Numbers
  1. Dim MyDB As Database, MyRS As Recordset, intNoOfRecords As Long
  2. Dim intRandomRecordNumber, intCounter As Long
  3.  
  4. Set MyDB = CurrentDb
  5. Set MyRS = MyDB.OpenRecordset("tblEmployees", dbOpenDynaset)
  6. MyRS.MoveLast: MyRS.MoveFirst
  7.  
  8. intNoOfRecords = MyRS.RecordCount          'will be the Maximum Value of the Bar
  9.  
  10. Me!ProgressBar1.Min = 1                            'Minimum Value
  11. Me!ProgressBar1.Max = intNoOfRecords      'Maximum Value
  12.  
  13. Do While Not MyRS.EOF
  14.    intCounter = intCounter + 1
  15.       'do some processing here...
  16.       Debug.Print UCase$(MyRS![LastName]) & " - " & Mid$(MyRS![LastName], 2, 4)
  17.       Me!ProgressBar1.Value = intCounter
  18.          MyRS.MoveNext
  19. Loop
  20.  
  21. MyRS.Close
NOTE: You could also use the Status Bar of Access as a Progress Bar. If you need further details, let me know.
Mar 2 '07 #3

abouddan
P: 42
Many thanks for your support Adezii

Yes please I would like to know more about the status bar as progress bar.
Mar 5 '07 #4

abouddan
P: 42
Dear Adezii

The code you sent is clear, but what I want to ask about is: where must I insert this code keeping in mind that I want that progress bar to run when openning a form or report?
Mar 5 '07 #5

Rabbit
Expert Mod 10K+
P: 12,315
You would put the code in the same section as the code that opens the form/report. Or you could put it in the On Open event of the form/report.
Mar 5 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.