Documentation of Access programming RunCommand constants

Posted on 2005-04-22
Last Modified: 2012-06-21

I am trying to understand an existing Access application so I can make a change to it.  I have the following code:
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdAdvancedFilterSort
'  Send a command to run a query based on current selection criteria that has been manually set up by user.
    SendKeys "qryFilteredRecordSource{Enter}", False
    DoCmd.RunCommand acCmdSaveAsQuery
    DoCmd.SetWarnings True

This somehow causes a query to be created (qryFilteredRecordSource) that selects records based on a form that had some selection criteria entered.  I want to create the query for only the record that is currently being displayed in a form.  I suspect I need to change the "DoCmd.RunCommand acCmdAdvancedFilterSort" statement somehow.  I have not been able to find any documentation on the web that explains the acCmdAdvancedFilterSort argument though so I haven't been able to understand exactly what it does or what I should do to change it to only select the currently displayed record.

I occasionally have to do minor maintenance on Access programs and finding good documentation at Microsoft's web site or elsewhere on the format and arguments of statements seems to be very difficult.  Is there a place that really documents all the parameters used in Access?

I would appreciate help in knowing how to change the code but I would REALLY appreciate suggestions on what resources to use to be able to understand Access code.  I have looked at a number of books on Access and VBA but never found any that has enough information to help me learn how to read and code properly.  It seems that they usually give general information about program type statements but when it gets to the specifics of the arguments there is not enough detail to get the job done.

Thanks for your help.

Question by:mgump9
    LVL 74

    Accepted Solution

    I don't know if there is any "Documentation" per se, on .RunCommand members.

    I would suggest opening up the Visual Basic Editor (Press: Alt-F11)
    Then press: F2 (To open the object browser)
    Then type: "acCmd" into the "search text" box, and click the "Search" Icon (the icon that looks like binoculars)

    It does not give you much help, but it does, a least, give you a list of all the "acCmd*" keywords

    Good luck
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    As the only poster, I did not recieve any feed back that my post DID NOT solve the problem.

    Therefore I would presume that I DID solve the problem.

    I feel I should be awarded the points

    Author Comment

    OK.  I appologize for not responding to boag2000's comments.  They were helpful so I have no problem awarding him the point.

    Thanks for you help.

    LVL 74

    Expert Comment

    by:Jeffrey Coachman

    Glad I could help.

    Take care!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now