Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Progress Bar for Access

Status
Not open for further replies.

ChrisOjeda

Programmer
Apr 16, 2003
45
US
Hi,

I did a search and came up with a variety of progress bars (some for VB5 or VB6, some for Access under various scenarios) that seemed to be a little more overhead than I need. All I want to do is the following:

1) Display a Progress Bar
2) Run through a module and at various points in the module update the Progress Bar. I don't want to update it basd on loops but just based upon reaching certain lines of code.

Can someone direct me to the right solution for this? Thanks
 
See thread 705-525445 and also 705-529865. What you want to do is quite easy. You don't have to use loops or counters if you don't want to - just hard code the messages.
 
Use two labels and overlay them. Call one lblProgressInner, make the fill colour whatever you want and make it borderless. Call the other lblProgressOuter and make the fill transparent - use whatever border you want. Make sure the left-hand sides are aligned. Then use the following to update the progress.
Code:
Private Sub ShowProgress(RCount As Long, TotalCount As Long)
Dim NewWidth As Single
If TotalCount = 0 Then
    NewWidth = 0
Else
    NewWidth = lblProgressOuter.Width * (RCount / TotalCount)
End If
lblProgressInner.Width = NewWidth
DoEvents 'To allow screen display to update
End Sub
Pass in the current value and the total value and it will adjust the width of lblProgressInner to that percentage of the width of lblProgressOuter. No controls needed, very little overhead.
 
I added this and it was very much appreciated by the end user. You guys are the best ! ! !

Thanks sooooo much... I didn't want to do overkill as I am backlogged with work at this new job...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top