Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15595

[RESOLVED] Hung but not hung

$
0
0
Ok, this is primarily a VBA (MS-Access) question. Please forgive me for posting it here (and move it if you must, but I'd really prefer that it stay here).

I've got a long-running loop running in some VBA (MS-Access) code. This is a joint project so I don't have total control of everything that's going on. Specifically, I can't put additional forms on the screen (without going through more hoops than I'd like).

To report that this long-running loop is still running, I'm doing something like the following:

Code:


    Dim sCaption          As String
    ' Save caption in sCaption so we can restore it.


    Do

        ' Check to see if we're done.

        iCounter = iCounter + 1
        Me.Caption = "Still working " & Format$(iCounter)
        SendMessageW Me.hWnd, WM_NCPAINT, 0&, 0&


        ' Do the work.

    Loop

    Me.Caption = sCaption


Everything is working fine, except ... after a while, MS-Access quits changing its title, and just reports that it's hung. I can do a Ctrl-Break and see that it's working. It just stops changing the title.

I thought of putting some DoEvents in, but that opens up a whole other can of worms. Preferrably, I'd just like a way to have MS-Access (via the VBA) continue doing its work and updating the title.

I considered playing around with PeekMessage, but I'm thinking y'all might have some better idea.

Take Care,
Elroy

Viewing all articles
Browse latest Browse all 15595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>