Results 1 to 4 of 4
  1. #1
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15

    open query command

    hi everybody, i hope this is a simple question for many of you. i have a subform within a main form. in the main form i builded a set of search/combo boxes and a command that has the following code:


    Code:
    cmdFilter_Click()
    DoCmd.OpenQuery "query1", acNormal
    End Sub
    i referenced the query to the search/combo boxes and it does work, the command filters the query. but obviouslt when i press the button it opens a new window and display the query in table view. what i want is to see the filtered query in my subform instead of having it displayed in another window.
    any help would be much appreciated!

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    For that to happen, you will need to make the subform recordsource the query.

    Alan

  3. #3
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15
    hi, thank your for your answer. could you give me more details, i am a beginner with access.thanks

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Open your subform in design view. Right click to get to the properties. Select Form. Select Data tab. In the box for the recordsource, select your query.

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

Similar Threads

  1. Command button to open Report
    By swagger18 in forum Programming
    Replies: 0
    Last Post: 11-17-2011, 02:56 AM
  2. Command button to open email template
    By avarusbrightfyre in forum Import/Export Data
    Replies: 5
    Last Post: 09-10-2011, 11:18 AM
  3. Command buttons to Open Forms
    By Ace Pioneer in forum Access
    Replies: 1
    Last Post: 11-30-2010, 06:32 AM
  4. Use a command button to open a form
    By johnpaul in forum Forms
    Replies: 24
    Last Post: 09-23-2010, 12:29 PM
  5. Replies: 1
    Last Post: 07-07-2010, 11:06 AM

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