RunCommand ClearGrid

D

DavidL

Why can't RunCommand find ClearGrid when a macro calls
it? ClearGrid shows up in the Command listing of the
macro page and acCmdClearGrid appears in VBE.

Thanks.

Env: Access 2003
ADO and DAO both active
 
V

Van T. Dinh

Have you got a Grid (DesignView of a Query) selected / being the current
Object?

The ClearGrid command is only available when the Grid is the "current"
Object.

This is not related to DAO or ADO.
 
D

DavidL

Thank you.

So what is the best way of clearing filters using Filter
by Form?

I would like to be able to just drag the ClearGrid button
onto my forms but I can't do this in Access 2003 -- not
sure about V12 yet.
 
V

Van T. Dinh

To remove Filter / Sort, use:

Action: RunCommand
Commmand: RemoveFilterSort

I think you misunderstood the ClearGrid Macro action.
The "Grid" here refers to the QBE (Query-By-Example) grid
that you use when you are designing a Query.

Besides AutoKeys Macro, I haven't written an Access Macro
since 1997. Since A97, Microsoft have been saying that
Access Macros are only available for compatibility and
Macro support may be withdrawn in future Access versions.

If you do any serious work in Access, I would suggest
moving to VBA rather than Macros.

HTH
Van T. Dinh
MVP (Access)
 
D

DavidL

This suggestion didn't work for me but thanks anyway. It
gave me a little practice with macros which I haven't
tried since my first Access class.

I will look for a solution in one of the many Access books
that I own.

David
 

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