Results 1 to 12 of 12
  1. #1
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368

    Progress bar issue


    Hi all, I have a form that has a progress bar that I'm trying to use in my workflows. This one doesn't track record counts like the ones posted in the forum already (which i took bits from) but which step in the workflow the system is currently on. The code so far looks like this:

    Code:
    Public Function ProgressBar(varAmt As Variant, varTotal As Variant)
    
    Dim ProgPerc As Single
        ProgPerc = varAmt / varTotal
        
        If ProgPerc  <= 1 Then
            Forms!frmProgressBar!lblProgressPerc.Caption = "Step " & varAmt & " of " & varTotal
            Forms!frmProgressBar!lblProgressMeter.Width = CLng(Forms!frmProgressBar!lblProgressPerc.Width * ProgPerc)
        Else
        End If
        Select Case ProgPerc 
            Case Is < 0.5
                Forms!frmProgressBar!lblProgressMeter.BackColor = 255
            Case Is < 0.75
                Forms!frmProgressBar!lblProgressMeter.BackColor = 65535
            Case Else
                Forms!frmProgressBar!lblProgressMeter.BackColor = 65280
        End Select
        
        If ProgPerc  > 1 Then
        Forms!frmProgressBar!lblDone.Visible = True
        Forms!frmProgressBar!cmdExit.Visible = True
        End If
        
    End Function
    Currently, the "Step # of #" is working fine as is the showing of the "done" and command button. However, The progress bar itself is not expanding. Not quite sure what I'm doing wrong. Help?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you're trying to expand the actual FORMS' width, it looks like. Is that it?

    I don't think that works unless you're in design view though, does it? And the examples on the forums, I think they use actual controls for progress bars, not form objects.

  3. #3
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I'm expanding the width of the label which is on the form, which is filled with a background color

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    my initial thoughts are:

    1) check the return of ".width" and see if you're dealing with twips. I think you are. Most dimensions are twips.

    2) try repainting ".repaint" the form after changing the width.

    3) are you sure you can change label width's dynamically? I've never seen it done with a label. I've always seen textboxes used.

  5. #5
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by TheShabz View Post
    so did my help help or not, sir?

  7. #7
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    the .repaint helped get the color on there and I made some tweaks in the rest of my code to get it working properly. Thank you.

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by TheShabz View Post
    the .repaint helped get the color on there and I made some tweaks in the rest of my code to get it working properly. Thank you.
    Interesting.

  9. #9
    RansomJ1 is offline Novice
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    1
    TheShabz, Can you post a copy of your final code with a simple sample of the procedure calling it? Thx.

  10. #10
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Yea. I'll get it tomorrow at work.

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  12. #12
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What Orange provided will have to do. The group I made that for decided they didn't want it anymore and got IT to delete it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Progress Bar
    By pkstormy in forum Code Repository
    Replies: 3
    Last Post: 09-21-2012, 10:27 AM
  2. Form Progress/Status Bar
    By Tomfernandez1 in forum Forms
    Replies: 2
    Last Post: 06-09-2011, 01:01 PM
  3. Progress/Status Bar on Form
    By Tomfernandez1 in forum Forms
    Replies: 5
    Last Post: 05-10-2011, 04:41 PM
  4. Sample Reporting/Exporting/Progress Bar
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 02:29 AM
  5. How to use progress bar
    By marianne in forum Access
    Replies: 19
    Last Post: 04-01-2009, 09:06 PM

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