Re: Queries involving subforms

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks for your reply.

To reword the question; is there anyway to base the criteria for a query on
data in a child table, which only returns the related parent row?

Thanks



"Jeff Boyce" <nonsense@xxxxxxxxxxxx> wrote in message
news:eNhWhbUxGHA.4256@xxxxxxxxxxxxxxxxxxxxxxx
Phil

Perhaps just a matter of semantics, but...

Queries don't work against forms. Queries are created to work against
tables of data, or against the data returned by (another) query.

If you join a main table and a related "child" table, you will get as many
rows as you have "children" for each "parent" row.

If you wish to see data from the child table, which one?!

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Phil" <philde@xxxxxxxxxxxx> wrote in message
news:44e9de5f$0$4196$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hopeing someone can help me here..

I have a main form with 1 subform, I want to make a query that returns
data for the main form, but using criteria from the related subform.

The problem i'm having is, if i use a normal select query based on both
forms, each record is listed as many times as the number of records in
the subform that match the criteria.

And of course if I group data from the subform in the query to limit the
records, it doesnt allow me to edit the data in the query.

Is there anyway to use criteria from a subform, but not actually include
the subform records in the query results at all? Or is there another way
around this?

Thanks for your help!


- Phil





.



Relevant Pages

  • Re: change text on tab based on data
    ... Any field in the criteria must be a field in the domain - in this case, ... Although I am not sure what this query is for. ... hand, if you have a query for each subform, then you don't need criteria to ... What I need to do is have each tab where the Record_ID is not null ...
    (microsoft.public.access.formscoding)
  • Re: Database Search Facility
    ... There is a generic "ad-hoc" report/query applet at ... > What I specifically want to do is construct a main form with a subform. ... > upper part of the main form will have criteria fields and a search button. ... > in the main form and linking them to a query. ...
    (microsoft.public.access.formscoding)
  • Re: Combo list dependant on main/subform field values
    ... In the RecordSource property of the combo box use a query that selects the ... In the criteria field of the query builder ... > I have a main form with a subform and a combo on the subform. ... > field txtSchoolID, bound to autonumber field SchoolID in tblSchools. ...
    (microsoft.public.access.formscoding)
  • RE: New Records not created in a nested form having subforms
    ... The way to relate records in the subform the the parent records in the main ... parent record the relate to the child record in the Link Master Fields ... SQL query, set up tables, etc) to access data from a outside table ...
    (microsoft.public.access.formscoding)
  • RE: Filtering a subform using many combo boxes
    ... SELECT AssignedPriority, AssignedPriorityDetail FROM tblAssignedPriority ... YES for all of the combo boxes.) ... I followed you instructions to the letter and every one of the criteria ... open the query "qryProjects" in design view. ...
    (microsoft.public.access.forms)