query parameters using sub forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using the following parameter in a query to get records from a table
using a sub-form:

[forms]![ProductTable]![subdetail].[Form]![ID]

If the sub-form has more than one record, the query takes only the FIRST
record and ignores the rest.

How can I include all records in the sub-form?

Thank you!
 
segurarl said:
I'm using the following parameter in a query to get records from a
table using a sub-form:

[forms]![ProductTable]![subdetail].[Form]![ID]

If the sub-form has more than one record, the query takes only the
FIRST record and ignores the rest.

How can I include all records in the sub-form?

Thank you!

With a parameter you can't. By the way it will use the currently selected
record in the subform, not necessarily the "first" one. This is the same
behavior you would get if the parameter were referencing a control on the
main form right? You would get a match on that control for the current
record, not for every record in the form's RecordSource.

Sounds like you need to add the table that the subform uses to your query
and then filter on the related field in the main table by referencing a
control on the main form.
 
Back
Top