Filtering a RecordSource

canadaboy

Registered User.
Local time
Today, 14:43
Joined
Sep 7, 2002
Messages
43
Filtering a Form Using a Query - See attached DB

Please find the 1 attached MS Access 2000 databases that has been considerably simplified in order to demonstrate my dilemma.

I want to know why Db1 works and Db2 does not. Db1 is attached to the post, but you can create Db2 by deleting column two in the design grid of “Query1”.

The desired result is to run “Macro1” and have it perform the single action of opening the only form and have it show only 3 of its 10 records (the ones where the technician’s name includes the letters “jab”). If you run “Query1” by itself in either of the databases, Query1 achieves this result and displays the proper records (Test #’s 2003-0003 , 2003-0005, and 2003-0010 ). However, when ‘Query1’ is used as a filter for the form, only the one that is ‘hard-coded’ in Db1 works. This ‘hard-coding’ of the criteria in the query is unacceptable and I need a work-around.

PLEASE HELP!!!!
 

Attachments

I think this was what you were after.

No need to play around with all those queries - just define the criteria within the macro.
 

Attachments

What if I do need to maintain the query structure that was in the original Db1?

What is not shown in the database is that the Experiments_Search_TBL (which will always only have a single record) stores the user's search criteria from a search form (not included in Db1). After the user has input his desired search criteria, he hits a command button that will open the Experiments form while filtering it based on "Query1" which is itself based on smaller queries of the Experiments_Search_TBL.

The fact that I have several fields that the user can specify for search criteria and that these data are stored in the Experiments_Search_TBL does not let me "hard-code" the criteria in the macro. I'ts too complex.

Can anyone see how to do it within the given Query structure.
 
Dan-Cat --

Without going into a lot of incoherent babble, I thank you for your input. While the 'hard-coding' was not to my liking, it got me thinking on a different path that I feel will work wonderfully. It does get rid of all those secondary queries, but uses a modified "Query1".

Thanks again for taking the time.
 

Users who are viewing this thread

Back
Top Bottom