Form with button - On Click runs macro

Ginny2222

Ginny
Local time
Today, 22:29
Joined
Oct 27, 2007
Messages
108
Hi all,

I have a macro built that outputs the results of a query directly to a new Excel Workbook. I then put a button on a form which when clicked runs the macro. My problem is that after the macro runs Access appears to lose my database (grey screen) and freezes. The only thing I can do is X out. It doesn't do this when I run the macro separately. Is there something I need to add to the macro to finalize the process. I have tried adding Close, Requery, CancelEvent, but to no avail. What am I missing? Is this a "garbage collection" issue?

Help appreciated

rgs
Ginny
 
My problem is that after the macro runs Access appears to lose my database (grey screen) and freezes. The only thing I can do is X out. It doesn't do this when I run the macro separately.
got any other code running behind the button (besides the macro)? Are you using A2007? Are you exporting data from Access that is in use by the source of the form that is open?
 
got any other code running behind the button (besides the macro)? Are you using A2007? Are you exporting data from Access that is in use by the source of the form that is open?

You are right Adam, I had begun coding before building the macro, but hadn't deleted it !! All fixed. Thanks - there had to be a logical explanation.

rgs
Ginny
 
You are right Adam, I had begun coding before building the macro, but hadn't deleted it !! All fixed. Thanks - there had to be a logical explanation.

rgs
Ginny
Not a problem. I do this sort of thing all day long, believe it or not. :) Good luck with the rest of the project...
 

Users who are viewing this thread

Back
Top Bottom