|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm not sure if this is possible, or if there is a better way to do this.
I have a form with data from a table in tabular form. My table has over 100 fields, but I am only using 10 fields to filter the data. However, I would like to be able to link to a query that brings up all of the information when I filter the form. My question is: Is there a way to link up or use a command button that will bring me to a query that will show all of the fields for only the specific filtered data? Any help would be greatly appreciated! |
|
#2
|
|||
|
|||
|
Are you using the in-built filter or have you created your own?
You could build your query with all the fields in and to filter on the 10 fields the criteria could look at controls on your form with the filter criteria in. |
|
#3
|
|||
|
|||
|
I have created my own. They are text or combo boxes for each field with a command button that filters the records and another command button to reset the data.
That query sounds like it would be something i would want, could you please elaborate? I'm not the best at building queries. Thanks! |
|
#4
|
|||
|
|||
|
Ok, try this:
1. Create a query in design view and add the table. 2. Dbl-click on the * at the top of your table (in the query) to bring all the fields in. 3. Dbl-click each field that you want to filter on to add them to the query but untick them so they do not show twice. 4. In the criteria for each filtered column add the control name e.g. if your form was called test and the filter control was called filter do this: [forms]![test]![filter] and so on. |
|
#5
|
|||
|
|||
|
I have made my query but when I press the command button I made to run the query, it asks for parameter values? When I insert parameter values, it works, but I would like it to be automatic.
Also, is there a way the query could open a form displaying the data? Thanks so much for the help. |
|
#6
|
|||
|
|||
|
I figured out the parameter values and now it works, however, if there are multiple results from the filter, the query opens only the first record. I would like it so that if there are four results for the filter, then four results would appear in the query. Thanks!
|
|
#7
|
|||
|
|||
|
Quote:
I don't quite understand why. If the query is setup correctly it should display the same as the form. |
|
#8
|
|||
|
|||
|
I set the query up following your instructions and it works perfectly with opening the results. It's just that it only opens the results that I click on. So if I click in a text box on record #3, then only record #3 will appear when running the query. It's not too much of a problem, but if you do know how to fix it I would appreciate it.
Otherwise, thanks for the help! |
|
#9
|
|||
|
|||
|
Yes, I think I know what the problem is. Because it is a tabular form the query is reading (filtering) from which ever record you have selected.
To get around this you would have to put the filter criteria (your ten filter fields) in the header of the form. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Filtered Data Linked to Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|