Populating a subform with data from a query
Hi.
I am struggling with a problem...
I have a form called Car_Search. The user selects a parameter such as car manufacturer or types in a model number that s/he wants to search for. The parameters are fed into a query that then returns the data as a datasheet. I would like the returned data to populate a subform that is positioned underneath the search fields within the main search form.
How can I implement this?
Thanks!
Jon
Re: Populating a subform with data from a query
Welcome to the Forums.
On the subform, you can set the "Source Object" to the parent form. Then
set the "Link Child Field" and "Link Master Field" to their respective fields.
Then when you filter the parent form it should reflect similar in the subform.
HTH
Re: Populating a subform with data from a query
Hi.
Thanks for the quick response.
I have linked the two together but when I hit the command button to run the query linked to the form (the query takes parameters from the form), I just get a separate datasheet pop up instead of the data passed to the subform?
Is there a way of taking the data from the query (it is currently displayed in the form of a datasheet that pops up) and feeding that into a datasheet below the main form?
Thanks again.
Jon
Re: Populating a subform with data from a query
Sorry for the delay.
If I understand correctly, you have a main form that has a table as a
recordsource. Then the popup secondary form runs as query but with a
parameter that the user selected. Now you want to load the datagrid data
in the popup secondary form back into the first main form?
Also, these are two separate forms and not a nested subform?
Re: Populating a subform with data from a query
Thanks for the reply but I handed in the piece of coursework today and so do not require any further assistance.
I can't remember what I did but I changed it in some way.
Thanks again.
Re: Populating a subform with data from a query