How to Disable Datasheet view in macro

  • Thread starter Thread starter John Michl
  • Start date Start date
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
 
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)
 
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?
 
*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)
 
Back
Top