Results 1 to 4 of 4

Thread: Hi there progress bar help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153

    Talking

    Hi there we have a main form which has a list box on it, we have made some code that fills the list box with dates. Each date is check against a time table and if the date appears to be free then it is added to the list box. This takes a little bit of time and we wish to display a progress bar on a different form. The only trouble is that when the dates are been created the form with the progress bar remains hidden and thus is in effective, how can we bring it to the top.


    Thanks guys.

    Rohan.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Use the DoEvents keyword in your loop.

    If i remember correctly you are using a SQL statement to get the data back, and then using a loop to check if the dates are free.

    In this loop do something like.

    Code:
    frmOtherForm.SetFocus
    
    do
      list1.additem myDate
      
      
      frmOtherForm.progressbar1.value = ?
      DoEvents
    loop

    Are you using that loop i wrote? is it working or was it complete crap? The first one i wrote i know was very slow.

    Goof luck.
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153

    Method not correct

    hi there, the method you just submitted appears not to work here is the code from the current procedure, check it out, any improvments are welcomed.

    lstAvailableDates.Clear
    lstChosenDates.Clear
    lstSlots.Clear
    Frame1.Visible = False
    frmLoading.Show 1

    Dim TestDate As Date
    Dim TestAmericanDate As String
    Dim Counter As Integer

    'On Error Resume Next
    ' lstAvailableDates.Clear
    ' lstChosenDates.Clear
    ' lstSlots.Clear
    ' Frame1.Visible = False
    ' TestDate = Date
    ' ReturnKey txtroomID, lstRooms
    ' For Counter = 1 To 365
    ' TestDate = DateAdd("d", 1, TestDate)
    ' TestAmericanDate = TestDate
    ' TestAmericanDate = AmericanDate(TestAmericanDate)
    ' With dtatakendates
    ' .RecordSource = "SELECT * FROM [Date] WHERE (Date.RoomID = " + txtroomID.Text + ") AND (Date.Date = #" + TestAmericanDate + "#)"
    ' .Refresh
    ' With .Recordset
    ' .MoveFirst
    ' .MoveLast
    ' If .RecordCount < 3 Then
    ' lstAvailableDates.AddItem TestDate
    ' CheckAvailableSlots AmericanDate(TestAmericanDate)
    ' End If
    ' End With
    ' End With
    ' Next Counter
    End Sub

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    okly doakly then.

    obviously you are not using the method i thought you were.

    Try.
    Code:
    'n.b. make sure the other form is visible and loaded.
    
    frmOtherForm.progressbar1.max = 365
    
    for Counter = 1 to 365
      'your code
      '....
      
      frmotherForm.progressbar1.value = Counter
      DoEvents
    Next Counter
    Iain, thats with an i by the way!

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