Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2009
    Posts
    95

    Unanswered: Subform - Data Display Problem

    I have a form with a subform, the subform displays information based on a combobox selection of company. However, there are multiple records of many companies in the table with some of the records having different addresses.

    I need the subform to only display unique/distinct records of the company based on the address.

    Any help would be greatly appreciated,

    Thanks,

    CT
    Last edited by CTChris; 06-08-09 at 12:43.

  2. #2
    Join Date
    Feb 2004
    Posts
    214

    ...

    Have a table with your company name, address, etc... Make the the data to your main form. the combobox should look up the record from this table by company name and the address and other info will pull up. For the subform, it needs to be based on a query where it matches the company name and address. All you need to do is use the following for your criteria in your query
    [Forms]![Your Form Name]![Company Name] and under address do the same [Forms]![Your Form Name]![Address]

    Hope this works.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  3. #3
    Join Date
    Jun 2009
    Posts
    95
    Example...

    Company1 - Address1 - etc
    Company1 - Address2 - etc
    Company1 - Address1 - etc

    Currently, when I selected Company1 from my combobox it displays the above.

    How do I get it to only display...
    Company1 - Address1 - etc
    Company1 - Address2 - etc

    The table with my information DOES have the two records of Company1 with Address1 but I only want my subform to display all records of the selected company with unique/distinct addresses.

    Thank you for additional aid,
    CT

  4. #4
    Join Date
    Feb 2004
    Posts
    214

    ...

    have the subform run from a query the removed dups. Make a count query (the count isn't important, but it will remove dups).

    hope this helps.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  5. #5
    Join Date
    Jun 2009
    Posts
    95
    Would you mind going into a bit more detail as to how to make a count query?

    Also, the count could come in to use, as another thing I need to figure out is once I get the addresses filtered properly, I need to display how many times each address occurs in the table.

    Thank you and sorry for my lack of knowledge, haha,

    CT

  6. #6
    Join Date
    Feb 2004
    Posts
    214

    ...

    No apologies needed. We all start somewhere and I still don't know a 1/4 of some people know on here.

    Onto the count query. when making a query there is a button on top with a Sigma (Greek letter that looks like an E). Click it and it will bring add a row to your query to sum, count, avg etc...Select count. Make sure to not display too many fields, the more fields, the greater the possiblity for each record to be unique and it will not remove any dups.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Quote Originally Posted by CTChris
    Company1 - Address1 - etc
    Company1 - Address2 - etc
    Company1 - Address1 - etc

    Currently, when I selected Company1 from my combobox it displays the above.

    How do I get it to only display...
    Company1 - Address1 - etc
    Company1 - Address2 - etc
    Add these fields to a query and group on them both.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Jun 2009
    Posts
    95
    How do I go about grouping them?

    Thanks,
    CT

Posting Permissions

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