Results 1 to 3 of 3

Thread: Progress bar using databound control (database)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    Please help my progress bar won't work any ideas? Here is part of the code for the command button regarding the progress bar. I am using a databound control called data2

    Private Sub Command4_Click()
    MousePointer = vbHourglass
    With ProgressBar1
    .Value = 0
    .Visible = True
    .Max = Data2.Recordset.RecordCount
    End With

    If Data2.Recordset.EOF = False And Data2.Recordset.BOF = False Then
    Data2.Recordset.MoveFirst
    Do Until Data2.Recordset.EOF
    ProgressBar1.Value = Data2.Recordset.AbsolutePosition + 1
    Data2.Recordset.MoveNext
    Loop
    End If
    With ProgressBar1
    .Value = ProgressBar1.Max
    .Visible = False
    .Value = 0
    End With

    'Use the Data Report object's Show method to
    'display the report on the screen
    'drtotals2.Show
    frmRptTotals.Show

    If cboMonth = "" Or cboYear = "" Then
    Unload frmRptTotals
    frmPendingPSR.Show
    MsgBox "Error please enter both Month and Year to generate or view a report"
    End If
    'If cboYear = "" Then
    'MsgBox "Error please enter Year to generate or view a report"
    'Unload frmRptTotals
    'frmPendingPSR.Show
    'End If

    '*************************************

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    Anyone can you help?

  3. #3
    Hyperactive Member
    Join Date
    Jun 1999
    Posts
    308
    Hi, Bebe.

    Code:
    MousePointer = vbHourglass
    With ProgressBar1
    .Value = 0
    .Visible = True
    .Max = Data2.Recordset.RecordCount
    End With
    
    If Data2.Recordset.EOF = False And Data2.Recordset.BOF = False Then
        Data2.Recordset.MoveFirst
        Data2.Recordset.MoveLast
        ProgressBar1.Max = Data2.Recordset.RecordCount
        Data2.Recordset.MoveFirst
            Do Until Data2.Recordset.EOF
                ProgressBar1.Value = Data2.Recordset.AbsolutePosition + 1
    
                Data2.Recordset.MoveNext
            Loop
    End If
    With ProgressBar1
    .Value = ProgressBar1.Max
    .Visible = False
    .Value = 0
    End With
    MousePointer = 0
    Larisa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width