Results 1 to 9 of 9
  1. #1
    mbolster is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    8

    Searching mutiple tables


    Hi, I'm having a problem searching certain criteria and displaying it in my form.

    My database is set up as having a table of contacts, with a contactID. There are also 4 tables of calls (call1, call2...), each linked to contacts with contactID.
    My form displays the contact information, as well as 4 subforms for the calls.

    I set it up so that the contactID for the calls would change when the contactID for the main form changed, so that the call information for that contact would show the right contact's calls.

    I also have a search that searches the information of the calls, but obviously displays all of the calls and the contact information for the records meeting that criteria.

    I'm pretty new to Access, so can any one please help me out and give me an idea of how to do this? Am i setting up the database wrong? Thanks a bunch!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I suspect you're setting up the db wrong. Why are there 4 tables for calls? I would expect 1 table, with perhaps a field to designate call type (or whatever the 4 tables represent).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mbolster is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    8
    There are 4 tables for calls because the calls are in order. The first call call1, second call2, etc. They are kind of distinct I guess. I believe this is what was asked, but I'm certainly no expert, and if a single table with all of the calls would be better for this, including a number for which call it is then I'm willing to chance it if it helps with this search problem.

  4. #4
    mbolster is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    8
    This SQL statement is sort of what I want

    SELECT * FROM contacts WHERE Form_contactsForm.Call1.Form.....Value = ?

    What should I put at ? if I want to get the results from a different table? The tables are linked by ContactID, so I figure there must be a way to do it...frustrating.

  5. #5
    Join Date
    May 2010
    Posts
    339
    I figure there must be a way to do it...frustrating.
    The reason for the fustration is.

    pbaldy wrote:
    I suspect you're setting up the db wrong. Why are there 4 tables for calls? I would expect 1 table, with perhaps a field to designate call type (or whatever the 4 tables represent).

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I definitely think you'd be better off with 1 table, with an additional field to signify which call it is (that assumes the 4 tables have the same fields). That will let you easily get a particular call number, all calls for a particular client, etc, just by adjusting query criteria.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    mbolster is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    8
    Ok, so assuming I have just one table for the calls. I need to find all of the calls done on a specific date, and then display a form that has all of the clients with calls that meet that criteria. I also need to display all of the other calls for that user. Is there a way to do this?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It should all be doable. You can base a form on a query with specific parameters, you can use the master/child links of a form/subform, etc.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    mbolster is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    8
    I finally found what I was looking for. Maybe I wasn't explaining it well enough. If any one is interested here is a link to the solution. Thanks for the help though

    http://allenbrowne.com/ser-28.html

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

Similar Threads

  1. Replies: 0
    Last Post: 09-07-2009, 04:27 PM
  2. Searching the database
    By rommelgenlight in forum Access
    Replies: 0
    Last Post: 03-29-2009, 10:38 PM
  3. Searching records....
    By knightjp in forum Database Design
    Replies: 0
    Last Post: 01-07-2009, 05:20 AM
  4. Searching Dates
    By knightjp in forum Database Design
    Replies: 2
    Last Post: 08-16-2008, 11:39 PM
  5. Help with Searching Dates
    By rededdie in forum Access
    Replies: 1
    Last Post: 11-02-2007, 08:34 AM

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