Results 1 to 7 of 7
  1. #1
    Collins is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    107

    Relationship Question

    I cannot get this work. Maybe it's not possible. I'll try to explain it and hopefully someone can figure this out.



    I have a table with 200 intersections in it. So my Intersection Form has 200 records. I have a crashes table with several crashes I want to link to each intersection making 2000 crash records in my Crashes Form. Now... When I have my Intersection Form open I can navigate to say record 10. The intersection of 5th and Maple and I know that over the years it's had 20 crashes. On the Intersection form I have a button that when I click it, it opens the Crashes Form. But when the Crashes Form opens it doesn't just show me 20 records for 20 crashes for the intersection of 5th and Maple. It shows me 2000 records for all the intersections and starts at record 1 of 2000.

    How do I get the form to show just the 20 crashes for that specific intersection instead of all the crashes for all the intersections?

    Is it a relationship thing? Can this even be done?

    Thoughts anyone?

  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,652
    Sounds like this would work:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Collins is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    107
    Thanks Pbaldy. But you have opened many other questions. LOL... Where does this code go? In the button properties? In the field properties? Also would I be able to add a record on the second form and still have it linked to the record in the first form?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Behind the button from your description:

    http://www.baldyweb.com/FirstVBA.htm

    You'd have to do something do keep new records linked. One way would be referring to the first form in the default value property of the textbox for the intersection.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Collins is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    107
    Sweet Baldy I'll give it try!!!

  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,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Another option:
    You could make the "Crashes" form a subform of the "Intersections" form. Then there is no code involved.

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

Similar Threads

  1. Table relationship question
    By Lothar in forum Database Design
    Replies: 4
    Last Post: 06-16-2014, 03:58 PM
  2. Database Relationship Question
    By Leonidsg in forum Database Design
    Replies: 7
    Last Post: 03-22-2013, 11:00 PM
  3. Relationship question
    By txlibertygirl in forum Access
    Replies: 2
    Last Post: 10-13-2011, 08:59 PM
  4. Relationship Question on one-many
    By daveofgv in forum Database Design
    Replies: 2
    Last Post: 05-08-2011, 10:39 AM
  5. Table Relationship Question!
    By mbake085 in forum Access
    Replies: 5
    Last Post: 08-05-2010, 09:50 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