Solved

Filters - easy question (need quick answer)

Posted on 1997-07-29
2
591 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
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

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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 …

757 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

20 Experts available now in Live!

Get 1:1 Help Now