Preventing Screen Repaint - what confilicts with Echo?

C

CSI

I inherited a rather long, badly written batch of code, and as I was making
some requested changes, I tried adding Application.Echo False (and True at
end) to hide the screen flashing during execution. This starts off working,
but stops working at some point and various forms start opening and closing
repeatedly, which is annoying and is slowing things down.

I'm assuming something is overriding Echo's ability to prevent the screen
repaint. Does focusing on a form or control, or maybe opening a form or
creating a new record in that form, override the Echo False? I'm not a VBA
pro, but I know enough to get by and am fairly comfortable with it.

I would gladly add more Echo False's throughout the code, if I just knew
where to put them... in other words, which commands are overriding Echo and
causing forms to open on the screen. Thanks in advance.
 
S

Stefan Hoffmann

hi,
I'm assuming something is overriding Echo's ability to prevent the screen
repaint. Does focusing on a form or control, or maybe opening a form or
creating a new record in that form, override the Echo False? I'm not a VBA
pro, but I know enough to get by and am fairly comfortable with it.
I would use Me.Painting in the methods, e.g.

Public Sub DoLongFlickeringOperation()

On Local Error GoTo LocalError

Me.Painting = False

'excute long, flickering code here

Me.Painting = True
Exit Sub

LocalError:
Me.Painting = True
MsgBox "Do'h!" & vbCrLF & Err.Message

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top