Solved

Filters - easy question (need quick answer)

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

617 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