• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

MS Access Percentage Bar on Form

What activeX object can I use to place a percentage bar on a custom form in MS Access to show the progress for a process.

If I use a text box and try to set the text box's value at various times throughout the process, the form will not refresh (even with refresh, requery, etc.)

Any suggestions?
0
arthurcid
Asked:
arthurcid
  • 4
  • 4
  • 3
  • +4
1 Solution
 
BrianWrenCommented:
I have one that is all Access code and form, which you can add to any DB.  I'd be willing to mail it to you.

It puts a popup form on the screen with your title, a progress bar across the midle, and a percent label below.

The way you call it determines whether you will be sending straight percent to it, or numbers where the meter figures out the percent.

Brian
0
 
arthurcidAuthor Commented:
Thanks a bunch, Brian.

Please send it to

greg.nixon@bankofamerica.com

As soon as I receive it, I will give you the points for the answer, so go ahead and suggest the comment above as the answer to the question.

Thanks again for your help.  It is greatly appreciated.
0
 
BrianWrenCommented:
To reinforce the philosophy that we like to 'answer' with comments in the Access topic area, allowing the asker to select a comment as answer, I'll leave it to you to instigate the 'answering' aspect.

Here it comes . . .

Brian
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
jsimonh33Commented:
Use the Microsoft ProgressBar Control.

It updates dynamically, and requires little to no coding effort.

Simon
0
 
BrianWrenCommented:
jsimonh33:  If you would be so kind as to lift your eyes 1/2 an inch above your 'answer' you will find, "we like to 'answer' with comments in the Access topic area, allowing the asker to select a comment as answer..."

If you will look just another 1/2 inch above that, you will find that arthurcid, (the person you are trying to 'help'), has already stated that it is his intention to award me with the points for this question.

It's fine to feel strongly that you have a good answer, but it would be good if you could avoid 'crashing through all of the walls in the house' to assert you opinion on that.

Brian
0
 
BrianWrenCommented:
Now going and trying the progress bar control, I must say that I have hated that text/graphics combination where the progress moves in giant, discreet steps.  It looks like a giant step backward in the interface to me.  (JMHO)

The form/code combination that I e-mailed moves in steps of 1 pixel each, (15 twips at the resolution that I use).

Additionally, my 'control' handles text-based announcing of the progress with no additional elements needed, (12%, 88%, etc.).

It's a toss-up  whether the thing I mailed being popup is better than having a control on your form that can be hidden or overlayed.

Brian
0
 
nmilmineCommented:
I would also be interested in  your code BrianWren

nmilmine@ihug.co.nz

Thanks
0
 
arthurcidAuthor Commented:
Brian,

I have been reading all the help/faq i can find at EE and do not see how to accept a comment as an answer.

I know it is probably a dumb question, but could you provide any further info on the subject?

Thanks again,
ArthurCid
0
 
JimMorganCommented:
arthurcid:  You won't see how to do that until you ask a question.  Then it automatically shows up on each comment line for you, the asker.  No one else sees it.

You might also want to just have the progress bar run on the status bar.  That is the easiest way.  We wrote progress meters, bought third party meters, and wound up using the status bar - much in the way you see the status bar change when you are opening a URL in Internet Explorer.

You use the SysCmd function.  This is a code example from Access help.  If you need more specifics as it applies to you, let me know.

Jim

The following example creates a snapshot-type Recordset object, reads each record, and displays a progress meter showing the current relative position in the snapshot.

Function ReadRecords(strTableName As String) As Integer
      Const conBadArgs = -1
      Dim dbs As Database, rst As Recordset
      Dim lngCount As Long, strMsg As String
      Dim varReturn As Variant, lngX As Long
      
      ReadRecords = 0
      If strTableName <> "" Then
            DoCmd.Hourglass True
            Set dbs = CurrentDb
            On Error Resume Next
            Set rst = dbs.OpenRecordSet(strTableName)
            ' Get record count.
            rst.MoveLast
            rst.MoveFirst
            If Err Then
                  ReadRecords = conBadArgs

End If
            lngCount = rst.RecordCount
            On Error GoTo 0
            If lngCount Then
                  strMsg = "Reading " & UCase$(strTableName) & "..."
                  varReturn = SysCmd(acSysCmdInitMeter, strMsg, lngCount)
                  ' Display message in status bar.
                  For lngX = 1 To lngCount
                        varReturn = SysCmd(acSysCmdUpdateMeter, lngX)
                  ' Update meter.
                        .                                                ' Do something with record.
                        .
                        .
                        rst.MoveNext                        ' Go to next record.

Next lngX
                  varReturn = SysCmd(acSysCmdClearStatus)
                  GoSub CloseObjects
                  ReadRecords = lngCount            ' Return number of records.
                  Exit Function
            End If
      End If
      ' Not found or contains no records.
      strMsg = "Table '" & strTableName & "'not found or contains no records.'"
      MsgBox strMsg, vbInformation, "ReadRecords"
      GoSub CloseObjects
      Exit Function
CloseObjects:
      On Error Resume Next
      rst.Close
      dbs.Close
      On Error GoTo 0

DoCmd.Hourglass False
      Return
End Function

0
 
dtomynCommented:
I haven't taken a good look at the code posted by JimMorgan and do not know what BrianWren's code looks like, but you might want to check out the following link:
http://www.smsb.demon.co.uk/downloads.htm
At this site is a fantastic download (that is just a form with code.. no OCX) called:
Progress bar drop-in subform [34k]

Contains a re-usable subform to provide progress (percentage) bar functionality to any form. A test form is supplied to demonstrate usage.

I use it quite often in my applications.
0
 
jsimonh33Commented:
Brian Wren,

We are all so very excited that you have been given priority for points. Please don't report me to the "help desk" police. My intention was to help without regards to reward, and encourage individual learning. I don't answer questions with intentions of earning any points, just helping others.
0
 
jsimonh33Commented:
Brian Wren,

We are all so very excited that you have been given priority for points. Please don't report me to the "help desk" police. My intention was to help without regards to reward, and encourage individual learning. I don't answer questions with intentions of earning any points, just helping others.
0
 
tomk120999Commented:
Ah, arthurcid, I see the experts are at it again, lots of good answers, I'm sure one will suit your needs.  I know I have benefitted.

jsimonh33, welcome to EE, I echo your desire to help, with or without points.  Brian was just explaining that we use a convention that allows the most flexibility and collaboration.  I, too, was kindly(?) chastised when I "answered" a question rather than commenting, but it really is the better way to exchange all ideas and let the questioner decide what's best for his or her particular need and skill level.  Please continue to chime in.
good luck as usual...
0
 
JimMorganCommented:
jsimonh33:  If you aren't answering questions to earn the points, then you should only make a comment.  Answering a question actually hurts the flow the thread and places the question in the 'locked' area, which discourages a lot of members from providing any more response.

Are you aware of the recently added option which allows you to change your answer back to a comment?  This was done just to help members like you who want to contribute and help others.  This will also allow ArthurCid to decide for himself who provided the best solution for his problem and save him the trouble of rejecting your answer.

If you have been following Access very long, you will see that I frequently provide more comment to a question to help make things clearer.  I almost never 'answer' a question.

Also, be kind to Brian.  He is an expectant Father - any day now.

Jim

0
 
JimMorganCommented:
That's amazing Tom.  Not that you made that comment but that I made my comment, submitted, saw my comment but not yours.  Then I get an email notification of your response after I was on to another question or two.  There has to be a problem with time stamps on EE.

Jim
0
 
JimMorganCommented:
ArthurCid:  Why did you accept jsimonh33's proposed answer?  I know that you were working with Brian via email.  Did the ProgressBar Control do what you wanted?  Just curious.

Jim
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 4
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now