Welcome to SPN

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

Sign Up Now!

2 Tables in one form?

Discussion in 'Information Technology' started by -Mark Shelby, Jul 28, 2006.

Tags:
  1. -Mark Shelby

    -Mark Shelby
    Expand Collapse
    Guest

    Lets say I designed two tables one called "Cities" and One called "States"
    Then I created a form and for simplicity's sake all I wanted to show was a
    text box for "City" data and a text box for "State" data. At this point I am
    not asking about relationships for tables or queries.

    Is there coding which will let me call up data from two different table and
    put it on the same form?

    I am pretty new at databases, so any basic help is appreciated.

    Seems like I can only associate one table at a time with a form. I can
    create a query which lists data from both tables dumped int the query, but is
    seems like I might be missing something pretty basic...
     
  2. Loading...

    Similar Threads Forum Date
    India 11 Constables Get Pregnant at Training School Breaking News Apr 26, 2011
    Warm Up with Winter Vegetables (Vegetarian Casseroles) Cooking & Recipies Feb 7, 2011
    India Two constables arrested for beating, extortion Breaking News Jul 27, 2010
    History Cleaning Out the Augean Stables Punjab, Punjabi, Punjabiyat Aug 25, 2009
    Sikh News Cold weather damages sugarcane, vegetables in Punjab (New Kerala) Breaking News Feb 1, 2008

  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    Hi Mark -- Unfortunately, to answer the question we have to talk about
    relationships. You need a connection between your tables which is
    accomplished by the way of a Primary Key (PK) and a Foreign Key (FK). In
    your Cities table you need a field that can relate to the States table: for
    grins, let's call it StateID.

    In the Relationships window, you establish the relationship between the two
    tables: goto Tools --> Relationships. The tables will be tied by the PK in
    the States table and FK in the Cities table.

    With this relationship established, you can use a query or forms/subforms,
    or forms and combo/list boxes, etc to display the data you want.

    "-Mark Shelby" wrote:

    > Lets say I designed two tables one called "Cities" and One called "States"
    > Then I created a form and for simplicity's sake all I wanted to show was a
    > text box for "City" data and a text box for "State" data. At this point I am
    > not asking about relationships for tables or queries.
    >
    > Is there coding which will let me call up data from two different table and
    > put it on the same form?
    >
    > I am pretty new at databases, so any basic help is appreciated.
    >
    > Seems like I can only associate one table at a time with a form. I can
    > create a query which lists data from both tables dumped int the query, but is
    > seems like I might be missing something pretty basic...
     
  4. -Mark Shelby

    -Mark Shelby
    Expand Collapse
    Guest

    Thanks for the reply! Lets complicate it even further. What if I added a
    table for "Zip" What would the relationship look like then?


    "xRoachx" wrote:

    > Hi Mark -- Unfortunately, to answer the question we have to talk about
    > relationships. You need a connection between your tables which is
    > accomplished by the way of a Primary Key (PK) and a Foreign Key (FK). In
    > your Cities table you need a field that can relate to the States table: for
    > grins, let's call it StateID.
    >
    > In the Relationships window, you establish the relationship between the two
    > tables: goto Tools --> Relationships. The tables will be tied by the PK in
    > the States table and FK in the Cities table.
    >
    > With this relationship established, you can use a query or forms/subforms,
    > or forms and combo/list boxes, etc to display the data you want.
    >
    > "-Mark Shelby" wrote:
    >
    > > Lets say I designed two tables one called "Cities" and One called "States"
    > > Then I created a form and for simplicity's sake all I wanted to show was a
    > > text box for "City" data and a text box for "State" data. At this point I am
    > > not asking about relationships for tables or queries.
    > >
    > > Is there coding which will let me call up data from two different table and
    > > put it on the same form?
    > >
    > > I am pretty new at databases, so any basic help is appreciated.
    > >
    > > Seems like I can only associate one table at a time with a form. I can
    > > create a query which lists data from both tables dumped int the query, but is
    > > seems like I might be missing something pretty basic...
     
  5. -Mark Shelby

    -Mark Shelby
    Expand Collapse
    Guest

    Thanks for the reply! Lets complicate it even further. What if I added a
    table for "Zip" What would the relationship look like then?


    "xRoachx" wrote:

    > Hi Mark -- Unfortunately, to answer the question we have to talk about
    > relationships. You need a connection between your tables which is
    > accomplished by the way of a Primary Key (PK) and a Foreign Key (FK). In
    > your Cities table you need a field that can relate to the States table: for
    > grins, let's call it StateID.
    >
    > In the Relationships window, you establish the relationship between the two
    > tables: goto Tools --> Relationships. The tables will be tied by the PK in
    > the States table and FK in the Cities table.
    >
    > With this relationship established, you can use a query or forms/subforms,
    > or forms and combo/list boxes, etc to display the data you want.
    >
    > "-Mark Shelby" wrote:
    >
    > > Lets say I designed two tables one called "Cities" and One called "States"
    > > Then I created a form and for simplicity's sake all I wanted to show was a
    > > text box for "City" data and a text box for "State" data. At this point I am
    > > not asking about relationships for tables or queries.
    > >
    > > Is there coding which will let me call up data from two different table and
    > > put it on the same form?
    > >
    > > I am pretty new at databases, so any basic help is appreciated.
    > >
    > > Seems like I can only associate one table at a time with a form. I can
    > > create a query which lists data from both tables dumped int the query, but is
    > > seems like I might be missing something pretty basic...
     

Share This Page