Full Version: No screen refresh after running code from a form's command butto
UtterAccess Forums > Microsoft® Access > Access Forms
szabof1
Hello Everybody,
Could anyone help me?
I have an Access application that starts with a form (menu) where users can press different command buttons. One of these buttons starts several make-table, add, and update queries.
When the code is finished the screen of MS Access is no longer refreshed. I have to close Access and open it again.
If I start the code manually by a macro (without my menu form), it runs correctly and keeps the screen updating.
What shell I do to get back the control of the screen?
Thanks in advance
Ferenc
Mical
Could you post a small database demonstrating the problem?
ical
szabof1
Mical,
THere is a very basic template of my database. It does the same strage thing.
Ferenc
Mitchell
Hi and welcome to Utter Access Discussion Forums frown.gif
Unfortunately eveytime I download you're attachment, I can't unzip it because it's corrupt.
But, what actually happens to the code, try single stepping through to see if the code is getting stuck somewhere which could result in you not having control of the form after clicking the button.
HTH
szabof1
Mitch,
Oattached the zipped DB again. On my side the zip is OK.
I did debugging. The code went through and finished correctly. Only the screen refresh was missing after the run.
When I run it from a macro it is absolutely correct, no screen refresh problem after the run.
Ferenc
Mitchell
I'm afraid it's time I hit the sack, at a glance I can't see what's causing it, but I'm a little puzzled by the 2 class objects Form_~TMPCLP43221 and Form_Correct Financials Data_Work that are in the VBE window. I have asked for others to take a look.
Sorry this hasn't been much help.
BenPurser
Alright, I'm gonna take a total SWAG at this, with the caveat that I haven't tested it. I took your form and changed the code so it runs the Loads function three times, with the same parameters your macro passed it. Same problem. In looking at your code, you have code in the form that sets up db as a database object...then you call a function, which also uses the db variable. That function ALSO calls functions, which ALSO uses the db variable....getting the picture? I think all these functions also use the qDef variable...
SO, what I'd do, is make all those database variables unique, and ALSO remember to close them out when you are done with them. Set db=nothing before your exit function lines, and before the end of the functions as well.
I have to admit to being too lazy to test this (OK, I also have a 50 page report that I am currently avoiding by being here), but it might be one avenue to explore.
HTH
Ben
szabof1
Ben
Odid what you proposed. Still does the same strange thing.
I made my code shorter. It uses now only one function. Still problematic.
After the code finishes Visual Basic editor is usable, MS Access in Windows Task Manager is running. But I cannot do anything but closing and restarting Access.
Ferenc
Chaga
That's because you turned Echo Off...
Just add this line at the end of your commands
DoCmd.Echo True
HTH
szabof1
Charles,
Thanks a lot! Really, that's the solution.
I have just logged in to post a message that I have found the solution that is "DoCmd.Echo True,..." instead of "DoCmd.Echo False,..."
Thank all of you for helping and thinking together.
Ferenc
P.S.
What does 'HTH' mean? (I saw it at the end of all of your posts.)
Chaga
You're welcome!
HTH = Hope This Helps
BenPurser
Chaga, YOU da man...good eye.
en
BenPurser
Glad you got it resolved, kudos to you and Chaga.....
HTH' means 'Hope This Helps'
Ben
viner1
Ferenc,
please drop me a line at: viner@eunet.yu
Ervin
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.