Solved

Filters - easy question (need quick answer)

Posted on 1997-07-29
2
619 Views
Last Modified: 2012-05-04
I am just missing something here I think, but I am trying to
run a filter on a table.  Heres the background, the user selects customers from a multi-pick list, these are then read into a table.  That part works.  

I then have a query that joins on the customer name to a table with customer data, and returns all the customer data, in effect only showing data about selected customers.  This is what my code does...

'DoCmd.OpenQuery "filtertest", acViewNormal, acEdit
DoCmd.OpenTable "RespondentList", acViewNormal, acEdit
DoCmd.SelectObject acTable, "RespondentList", False
DoCmd.ApplyFilter "filtertest"

on this last line (filtertest is the query mentioned above) I get an error Runtime error 2488, says that I have not selected a table to perform the query on.  And mentions that I should use SelectObject, which I do, but no to avail.  I need this answered pretty fast...

thanks, Matt Fischer
0
Comment
Question by:mfischer2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Lesand earned 180 total points
ID: 1955452
Perhaps I don't know what you are trying to accomplish.

If you want to return a datasheet by means of a query that has been limited to a list of user-selected customers then do the following:

Create a query with 2 tables:
    All_Customers_DataTable
    User_Selected_Customers_List

In the QBE grid, link the tables on a common key field and  make sure that the link returns only records where the two fields are equal.  Save the query.
Now it will automatically return records filtered to those listed in the User_Selected_Customers_List

In code you can use docmd DoCmd.OpenQuery "filtertest", acViewNormal, acEdit   and it should always return the recordset limited by the user selections


0
 

Author Comment

by:mfischer2
ID: 1955453
I ended up not using filters, but thanks for the help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

739 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