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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphical window to alert users to long-running code? 1

Status
Not open for further replies.

Dor100

Technical User
Apr 9, 2001
279
US
I'm developing in Acc 2002, and would like to be able to open one of those nifty little windows with a pulsing image of some kind, such as sequential bars, when users are running a program that takes a long time to complete (don't want them to have to sit there with a frozen screen for what could be up to a few minutes). Does Access have any capability like this?
 
Hi, if your using classes you can use events - if not then you can change an image or label caption in the variuos parts of the routine... the example below is taken from some code that loops through some 4,000 records and updates a label on a 'loading...' form every 150 records. Isloaded is a function from the Northwind database that just checks that the form is actually loaded rather than causing an error (I can post it if you cant find it)...
Code:
' mid loop...
        If nUniqueID Mod 150 = 0 Then
            If Isloaded("frmLoad") Then
                Forms!frmLoad.lblProgress.Caption = "loading" & String(n, ".")
                n = n + 1
                If n > 3 Then n = 0
                DoEvents
            End If
        End If
        nUniqueID = nUniqueID + 1

HTH, Jamie
FAQ219-2884
[deejay]
 
hi, also - if you want to adapt the above to change a picture instead of text add four images.
imgProgress should be visible, img1, img2, img3 should be hidden but be the sequence you want to change the images in...
Code:
arrControls() = array("img1", "img2", "img3")
' mid loop...
        If nUniqueID Mod 150 = 0 Then
            If Isloaded("frmLoad") Then
                with Forms!frmLoad
                    .imgProgress.PictureData = .controls(arrControls(n)).PictureData
                n = n + 1
                If n > 3 Then n = 0
                DoEvents
            End If
        End If
        nUniqueID = nUniqueID + 1


HTH, Jamie
FAQ219-2884
[deejay]
 
jksmi - thanks a lot! I was able to adapt your first solution into a module. This is a nice feature that I've long wanted to include. Can hardly wait to get around to your picture option when I get the chance. Here's what I've done, looping through records in a recordset object (r5):

r5.MoveNext

If r5.EOF Then
[Form_MyForm].Lbl.Visible = False
GoTo lineR5EOF
ElseIf [Form_MyForm].Lbl.Visible = False Then
[Form_MyForm].Lbl.Visible = True
End If

uid = r5(0)

If uid Mod 5 = 0 Then
If IsLoaded("MyForm") Then
[Form_MyForm].Lbl.Caption = "loading" & String(N, ".")
N = N + 1
If N > 5 Then N = 0
DoEvents
End If
End If
'uid = uid + 1 (not needed here)

Can you fill me in a bit more on the part about "if your using classes you can use events"? if you see this thread again?

Thanks again - you definitely get a vote from me for this week. Have had this goal on the back burner for some time, and it will benefit the users here when the app is tied up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top