Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Confusion (2000)

    I have a query (1) that takes criteria from a field on a sub form. The field takes values from a n other query (2) producing two records for the field. When the query (1) is run it only shows the first record from the field and not the second. How can I remedy this issue?

    Thanks Darren.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query Confusion (2000)

    Could you try again, more clearly and with more specific information? A sentence like "The field takes values from a n other query (2) producing two records for the field" doesn't make much sense to me.

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Confusion (2000)

    Ok, sorry Hans. Query (A) takes criteria from a field on a sub form. This field only ever has two records at any time say fish in one entry and chips in the second entry. when query (A) is run i want it show the records with fish and seperately with chips. However at the moment it just takes the first record entry eg fish.

    Thanks Darren.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query Confusion (2000)

    Although the subform may contain multiple records, only one record is current. If you have criteria in a query referring to a control on a form, the value of the control in the current record is used. Unless you have clicked in another record, the first record in the subform will be the current record, hence the result you get.

    You will have to do this another way: you need to work with the field that links the main form and subform, and use the value of this field in the main form as criteria.

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Confusion (2000)

    thank you Hans.

    Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •