Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Subsets (not sure if that is the correct phrase)

    This is my first post to a forum ever, but I'm stumped! So bear with me.

    I am in the process of creating a database that consists of People who own companies (ranging from 0 companies to 20 companies). Every business is linked to an individual but not every individual is linked to a business. I have 3 different tables that I am working with right now:

    a) A table for Individuals with all of their information including their "client number" (primary key).

    b) A table for businesses with all of the business info including the "client number" that corresponds to the Individual that company belongs to as well as a unique "business number" (primary key) that is unique to that business.

    c) A table for invoices of all work that we have done--if the work was done for an individual I used the "client number" to associate it and if the work was done for a business I used the "business number" to associate it.

    I would like to create 2 different parameter query's:

    1) where if I type in an Individual's client number, all the businesses it owns will populate


    2) where if I type in an Individual's client number all invoices associated with it PLUS all invoices associated with it's businesses will populate.

    PLEASE HELP!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by LifeIsBeautiful View Post
    I would like to create 2 different parameter query's:

    1) where if I type in an Individual's client number, all the businesses it owns will populate
    2) where if I type in an Individual's client number all invoices associated with it PLUS all invoices associated with it's businesses will populate.

    PLEASE HELP!
    1)
    Code:
    select * from businesses
    
    where clientnumber = [enter client number]
    2)
    Code:
    select individuals.clientnumber, invoices.invoicenumber
    
    from invoices innerjoin individuals on
    
    individuals.clientnumber = invoices.clientnumber
    
    where indiv.clientnumber = [enter client number]
    that is not tested and is probably not 100% accurate. let the query grid build the joins for you, don't type them in.

    and remember with parameters, you have to enter them into the query builder otherwise you'll get popup windows (I think). in design view of queries, there is always a button near the top called ''parameters''!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. What is the correct syntax for
    By giladweil in forum Access
    Replies: 1
    Last Post: 07-29-2010, 04:56 AM
  2. trouble creating correct criteria
    By pshawk in forum Queries
    Replies: 1
    Last Post: 02-12-2010, 01:52 AM
  3. Opening form to correct record. Bookmark?
    By stephenaa5 in forum Forms
    Replies: 11
    Last Post: 12-29-2009, 02:43 PM
  4. Trouble viewing correct data
    By KevinH in forum Access
    Replies: 11
    Last Post: 07-06-2009, 07:16 PM
  5. not correct running total in group
    By cmk in forum Reports
    Replies: 1
    Last Post: 12-06-2006, 05:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums