Why does docmd.echo False in pop-up cause another form to freeze up?

Rx_

Nothing In Moderation
Local time
Today, 02:38
Joined
Oct 22, 2009
Messages
2,803
Remarking out the doCmd.Echo False solved the problem. Why does this happen?

Splash Screen - button --> Single Form with List box & several buttons --> Tab Form Pop-up with buttons --> single pop-up (code in close button)

Going backwards - the Single Form with List box & Several buttons totally locks up. Unless the docmd.Echo False is remarked out. Why?

A splash screen with a button opens a form with a list box and category buttons, that opens a specific pop-up form. This pop-up form opens a pop-up form for bulk update.
Now, this last pop-up form had the code in the cancel/close button

Private Sub cmdCancelUpdate_Click()
On Error Resume Next
'DoCmd.Echo False
DoCmd.Close
End Sub

Before the 'docmd.echo False was remarked out;
The last pop-up would close
The next to last pop-up would close when it's close button was selected.
The next form would be frozen. Nothing would respond. Closing Access was the only option.

Once the docmd.echo False was remarked out - every thing test perfect.
If the very last pop-up was closed with the X in the form upper right - (avoiding the docmd.echo) the failure did not happen either.

A little strange it was two levels down!
The docmd.echo false was from a copy paste - I didn't think it would hurt.
 
Had to look into this a little more. Sure enough the Echo was the problem.
Here are a few previous post about it and the Access 2010 small reference to the matter to share with others. The WHY is still a little fuzzy as to how the form frozen was after a popup of a popup was closed.

http://www.access-programmers.co.uk/forums/showthread.php?t=174115
Same problem
http://www.access-programmers.co.uk/forums/showthread.php?t=112193
Discusses Echo doesn't work on Modal form
The help file actually says that the echo doesn't work with model forms:

The Echo method doesn't suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets.

Note: Don't confuse the Echo method with the Repaint method. The Echo method turns screen repainting on or off. The Repaint method forces an immediate screen repainting.

Thus the reason the repaint method has no arguments.

http://msdn.microsoft.com/en-us/library/office/ff834500(v=office.14).aspx
The Echo method does not suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets.
 
The form does not lock up. It just appears to because the screen is no longer updated. Normally it is only switched off to stop flickering of busy events. It can also substantially speed up the process because it saves the delay while writing to the screen.

When Access appearss to be "locked up" simply type Echo True in the immediate window and it will displaythe current state of things.

I cannot image any reason to turn off Echo and leave it off in any sub as you have done in your example.

Always turn it back somewhere and especially in in the error handler of any sub that turns it off.
 
  • Like
Reactions: Rx_
I think you are absolutely correct. Thanks for the great explanation.

Let me suggest a reason to leave it off. The Splash Screen that stays open to link the initial session?
In my haste, that is where I copied and pasted the code for the Close button.
Let me know, because that is the only place it stays off.

Hopefully this will help someone, it sure surprised me - being two layers deep.
 
The Echo Method is Application wide and it should not matter how ‘deep’ it is.
DoCmd.Echo False
Application.Echo False
same thing, once it’s off; it’s off.

Would not this whole subject depend entirely on the visual effect you require at startup?

Depending on the visual effect required, why not:-

Open Splash Screen
Application.Echo False
Run code to link the initial session.
Application.Echo True
Close Splash Screen
Open Main Menu.

A simple way to test this is to:-
Make a backup.
Delete everything not required to get to the active Main Menu.
Test till it works.
Import the modifications back into the real FE.


Chris.
 

Users who are viewing this thread

Back
Top Bottom