Results 1 to 3 of 3
  1. #1
    Acc4me is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2009
    Posts
    9

    Talking Need help to save query.

    I have a filtered form with a button which uses “DoCmd.RunCommand acCmdAdvancedFilterSort” to open a query. This code is in the form’s button on click event. When the query opens, how do I save it for example as QueryX. In addition, with each new filtered records I want to use the button to overwrite the query with the same name without being asked for a new save name. Am I asking for the impossible? Any help or ideas will be greatly appreciated.

    Acc4Me

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Try
    Code:
    docmd.setwarnings false
    DoCmd.RunCommand acCmdAdvancedFilterSort
    docmd.save acQuery "QueryX"

  3. #3
    Acc4me is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2009
    Posts
    9

    Query problem

    Quote Originally Posted by JeroenMioch View Post
    Try
    Code:
    docmd.setwarnings false
    DoCmd.RunCommand acCmdAdvancedFilterSort
    docmd.save acQuery "QueryX"
    Thanks for the response. The code "docmd.save acQuery, "QueryX"" doesn't seem to work. When I select the command button, a new query opens as before.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 06-20-2012, 09:50 AM
  2. Replies: 2
    Last Post: 04-12-2012, 10:07 AM
  3. [Unconventional] Save form then run query
    By shelzmike in forum Programming
    Replies: 2
    Last Post: 11-01-2011, 03:29 PM
  4. Save a Query as a database ?
    By mrkaye in forum Access
    Replies: 1
    Last Post: 05-03-2011, 03:02 PM
  5. Replies: 9
    Last Post: 01-20-2011, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums