Docmd.Echo not working

branston

Registered User.
Local time
Today, 16:00
Joined
Apr 29, 2009
Messages
372
Hi.

Is there any reason why the DoCmd.Echo False comand would not stop screens from flashing up when things are happening?

It was working fine, but for some reason it isnt anymore.

Any suggestions would be greatly appreciated.

Thankyou!
 
I generally use DoCmd.Echo for sending text to the status bar. Don't know if applies to what you are referring to.

Access Says:

As it applies to the Application object.

The following example uses the Echo method to prevent the screen from being repainted while certain operations are underway. While the procedure opens a form and minimizes it, the user only sees an hourglass icon indicating that processing is taking place, and the screen isn't repainted. When this task is completed, the hourglass changes back to a pointer and screen repainting is turned back on.

Public Sub EchoOff()

' Open the Employees form minimized.
Application.Echo False
DoCmd.Hourglass True
DoCmd.OpenForm "Employees", acNormal
DoCmd.Minimize
Application.Echo True
DoCmd.Hourglass False

End Sub

As it applies to the DoCmd object.

The following example uses the Echo method to turn echo off and display the specified text in the status bar while Visual Basic code is executing:

DoCmd.Echo False, "Visual Basic code is executing."
 
Yes, the part that im using it for is the preventing the screen from re-painting.
I have used it in a lot of other places in my code and it works fine, but for some reason it doesnt want to here. The section it wont work on is quite long, but a minimised example is below. Have i put it in the wrong place or something?

Private Sub Button_Click()
Dim StrSure as string

StrSure = MsgBox("blah blah")
DoCmd.Echo False, "Processing, please wait"
Docmd.Hourglass True

If StrSure = vbNo Then
'Code
Else
'Code
End If

DoCmd.Hourglass False
DoCmd.Echo True

EndSub

Its really starting to anoy me now... I just cant see a reason why its not working!!
Maybe a fresh pair of eyes will point out something really obvious (im hoping!)

Thanks!
 
What exactly is "Flashing Up"?

I am beginning to to think they are wanring messages about appending, deleting, etc. If so you need to turn this off and on using the DoCmd.SetWarnings False/True command.

David
 
No, afraid not. The main section of code basically opens a lot of tables and copies parts, pastes them in other tbales etc, and whats flashing up is every table that being opened.

By the way, I realised I have the hourglass comand the wrong side of the echo comand. Changed that now! Doesnt effect the problem though. :-(

Thanks for your quick reply though DCrake.
 
Never come accross anything like that before seems to me you may have a few gremlins playing about inside you app. Have you tried to rebuild it into a new blank mdb?

Are the tables linked?

David
 
Yeah, the tables are linked.
I do seem to be coming across quite a few strange things. Not really up for rebuilding it all though - its taken me about 2 months so far! Or is it just a point of just copying and pasting every table/form/qry into a new database? If so, would all the links between queries and things remain?
 
If you create a new blank database then goto file get external data import and point to the original database and select all the objects minus the linked tables and select import. This will copy all your queries, forms, reports, etc into the new database. Then use link table manager to link the new mdb to the back end tables.

Then retry.

If you have any import/export specs or relationships in place remember to include those.


David
 
Yes, if you include the modules. Any code in your forms will automatically be copied with form.
 
I know this thread is old. But I wanted to add this note.

This actually happens to me occasionally in access and A LOT in excel (where it's Application.Screenupdating=False).

If you have a lot of code that would normally do a lot of aggressive screen updating, and that code starts really fast right after a MsgBox "ok" button, then I've noticed that turning off echo/screenupdating simply doesn't work at that point in the code.

The solution is simple - just put it before that last drop-dead point (the msgbox).

I encounter the exact same problem all the time with temporary re-captioning of labels.

My code says:

'button Click event, or whatever
Msgbox "Get ready to rock 'n roll", vbOK," "
Label1.Caption="Processing.."
'a bunch of fast moving, screen-crazy code here
Label1.Caption="Finished"

But, I find that what I need to do is this:

'button Click event, or whatever
Label1.Caption=Processing..."
Msgbox "yes/no" variable"
If yes, proceed (and label caption - or in your case, Echo.False) "sticks"
if no, reverse (label caption originally, or in your case, Echo.True)
end if

etc

So long story short, I often need to move my line of code that does ANYTHING (like turning off screenupdating, OR a temporary label re-paint, etc.) to another step back from the start of fast moving code.
 

Users who are viewing this thread

Back
Top Bottom