Form Details As Query Criteria

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

I have a datasheet, data entry subform and I would like to
use a field "Order" as the criteria for an append query.
I have used;
[Forms]![OrdersTempNumbers]![OrdersTempNumber-sub]![Order]
This works if there is only one record but if you have two
or more it only returns the first record.
Is this possible?

Regards
Nick
 
Nick

You are correct, the criteria referenced to a form control will refer to
the current record on the form or subform.

In the situation you described, if you want the query to return records
that match all the order records on your subform, and I would expect
that all the orders on your subform are in fact shown on the subform
because these records all already match some other criteria, probably
based on a field on the main form, and the field that is the basis of
the relationship between the main form and the subform, then... maybe
you can use this field in the query criteria instead? Hope this makes
sense. If what I have said doesn't relate, please post back with more
details, with examples, of the main form data, subform data, and the
query you are trying to construct.
 
Steve,
Thank you for your assistance and yes what your saying
makes perfect sense.
From what you said I have found an alternate solution.

Regards
Nick
-----Original Message-----
Nick

You are correct, the criteria referenced to a form control will refer to
the current record on the form or subform.

In the situation you described, if you want the query to return records
that match all the order records on your subform, and I would expect
that all the orders on your subform are in fact shown on the subform
because these records all already match some other criteria, probably
based on a field on the main form, and the field that is the basis of
the relationship between the main form and the subform, then... maybe
you can use this field in the query criteria instead? Hope this makes
sense. If what I have said doesn't relate, please post back with more
details, with examples, of the main form data, subform data, and the
query you are trying to construct.

--
Steve Schapel, Microsoft Access MVP
I have a datasheet, data entry subform and I would like to
use a field "Order" as the criteria for an append query.
I have used;
[Forms]![OrdersTempNumbers]![OrdersTempNumber-sub]! [Order]
This works if there is only one record but if you have two
or more it only returns the first record.
Is this possible?

Regards
Nick
.
 
Back
Top