How to Disable Datasheet view in macro

J

John Michl

I've taken over a macro from a past employee that runs about a dozen queries
that delete, make and append tables and eventually outputs everything to an
Excel sheet.

SetWarnings On is set to NO.

The macro runs unassisted until it creates the Excel sheet but upon return
to Access a cross-tab query is showing in datasheet view mode. No other
queries show in datasheet.

How can I prevent this one query from littering the screen?

Thanks.

- John
 
V

Van T. Dinh

Not a lot of info. for use to go on but my guess is that a
Query is opened by one of the Macro actions (OpenQuery
action?) and you need to either remove this Macro action
from the Macro or add a Close action at the end of your
Macro to close the DatasheetView of the Query.

If you are not sure or familiar with Access Macros, make
sure you have a working back-up copy of the database.

HTH
Van T. Dinh
MVP (Access)
 
J

John Michl

Thanks Van.

Yes, the Query is opened by the macro action (OpenQuery). However, so are
about 10 queries before it and two queries after it but non of them show up
in the view. On the macro screen, all of these queries show the View =
Datasheet and Data Mode = Edit. Most of the other queries are delete table
and append table queries. Could it be that this Crosstab query has
something to do with it showing up?
 
V

Van T. Dinh

*Action* Queries such as Append / Update / Delete Queries
don't have DatasheetView regardless of the arguments of
the Macro actions. Only Select and Cross-Tab Queries do
show up in DatasheetView.

Why did the original designer showed the Cross-Tab Query
if you didn't need it?

My advice in the previous post should fix it.

HTH
Van T. Dinh
MVP (Access)
 

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