Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

query a form?

Discussion in 'Information Technology' started by Cristina, Nov 9, 2005.

Tags:
  1. Cristina

    Cristina
    Expand Collapse
    Guest

    Hi everybody.

    I am trying to build a relational database. This is a complicated task for
    me... as I started using Access2003 only 2 weeks ago. I have created the
    structure, no problems. Now I am trying to build a query on the entire
    database. Is that possible? Otherwise, I have a form that contains all the
    informations I want to query, is it possible to build a query on this form.
    And if yes, how? The other option, the easiest I guess, would be to query the
    central table of my database, hoping that Access will look in the related
    tables for information. I did it, but something went wrong.

    Hope someone can help.
    Cheers,
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Tue, 8 Nov 2005 07:46:09 -0800, "Cristina"
    <Cristina@discussions.microsoft.com> wrote:

    >Hi everybody.
    >
    >I am trying to build a relational database. This is a complicated task for
    >me... as I started using Access2003 only 2 weeks ago. I have created the
    >structure, no problems. Now I am trying to build a query on the entire
    >database. Is that possible?


    Sometimes... but it's almost never the right way to go.

    >Otherwise, I have a form that contains all the
    >informations I want to query, is it possible to build a query on this form.


    You have it backwards. A Form contains no data: it's just a tool, a
    window. You'll typically base the Form on a Query, and once in a while
    you'll reference a form control as a criterion in a query - but you
    cannot base a Query on a Form.

    >And if yes, how? The other option, the easiest I guess, would be to query the
    >central table of my database, hoping that Access will look in the related
    >tables for information. I did it, but something went wrong.


    The most common solution is to use the powerful Subform control. Base
    your main form on the "one" side, "main" table; on that Form put one
    or more Subforms bound to the "many" side tables.

    Take a look at the Orders form in the Northwind sample database for an
    example.

    John W. Vinson[MVP]
     
  4. Bob Miller

    Bob Miller
    Expand Collapse
    Guest

    If you mean by "entire database" all the tables in the database, it is
    possible to include all of them in one query.
    You will base your forms (generally for data input) on tables and/or
    queries.
    As a simple example you might have a personnel table with:
    FirstName, LastName, Address, City, Phone, etc. and an EmployeeID as
    the primary key.
    You can then create a table that has all Training courses employees
    take with:
    ClassName, Date, and EmployeeID.
    Once you entered all the employee data you can enter training data for
    each employee in the same table needing only the EmployeeID for the
    emplyoyee info.
    You could then create a query:
    SELECT Personnel.EmployeeID, Personnel.LastNAme, Personnel.FirstName,
    Personnel.Address, Personnel.City, Personnel.Phone, Courses.Course,
    Courses.Date
    FROM Personnel INNER JOIN Courses ON Personnel.EmployeeID =
    Courses.EmployeeID;
    This query will list a line for each course everyone took.
    I hope this helps,
    Bob

    Cristina Wrote:
    > Hi everybody.
    >
    > I am trying to build a relational database. This is a complicated task
    > for
    > me... as I started using Access2003 only 2 weeks ago. I have created
    > the
    > structure, no problems. Now I am trying to build a query on the entire
    > database. Is that possible? Otherwise, I have a form that contains all
    > the
    > informations I want to query, is it possible to build a query on this
    > form.
    > And if yes, how? The other option, the easiest I guess, would be to
    > query the
    > central table of my database, hoping that Access will look in the
    > related
    > tables for information. I did it, but something went wrong.
    >
    > Hope someone can help.
    > Cheers,



    --
    Bob Miller
     
  5. Cristina

    Cristina
    Expand Collapse
    Guest

    Thank you guys!
    Cristina

    "Bob Miller" wrote:

    >
    > If you mean by "entire database" all the tables in the database, it is
    > possible to include all of them in one query.
    > You will base your forms (generally for data input) on tables and/or
    > queries.
    > As a simple example you might have a personnel table with:
    > FirstName, LastName, Address, City, Phone, etc. and an EmployeeID as
    > the primary key.
    > You can then create a table that has all Training courses employees
    > take with:
    > ClassName, Date, and EmployeeID.
    > Once you entered all the employee data you can enter training data for
    > each employee in the same table needing only the EmployeeID for the
    > emplyoyee info.
    > You could then create a query:
    > SELECT Personnel.EmployeeID, Personnel.LastNAme, Personnel.FirstName,
    > Personnel.Address, Personnel.City, Personnel.Phone, Courses.Course,
    > Courses.Date
    > FROM Personnel INNER JOIN Courses ON Personnel.EmployeeID =
    > Courses.EmployeeID;
    > This query will list a line for each course everyone took.
    > I hope this helps,
    > Bob
    >
    > Cristina Wrote:
    > > Hi everybody.
    > >
    > > I am trying to build a relational database. This is a complicated task
    > > for
    > > me... as I started using Access2003 only 2 weeks ago. I have created
    > > the
    > > structure, no problems. Now I am trying to build a query on the entire
    > > database. Is that possible? Otherwise, I have a form that contains all
    > > the
    > > informations I want to query, is it possible to build a query on this
    > > form.
    > > And if yes, how? The other option, the easiest I guess, would be to
    > > query the
    > > central table of my database, hoping that Access will look in the
    > > related
    > > tables for information. I did it, but something went wrong.
    > >
    > > Hope someone can help.
    > > Cheers,

    >
    >
    > --
    > Bob Miller
    >
     

Share This Page