Finding record ID that is connected to current record ID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dpot
    New Member
    • Oct 2014
    • 30

    Finding record ID that is connected to current record ID

    I have a form that starts off blank, and on that form I have a button to add a second page. All it's doing is opening up another blank form with a brand new ID number. What I did though is I hid the new ID Number and created a box that shows the ID number of the first page. So to the user it looks as though page 1 and 2 are the same record when really page 1 is record number 25 and page 2 is record number 26 but it displays as 25. The problem I'm running into is on another form that was created to pull information out of the table after it had been entered. I can get the first page (the first record) to display just fine but when I click my page two button to pull up the second page I get an error. What is a good way to link the fake ID number (which is the Real ID number of page 1) and the real ID number of page 2?
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    If you are only ever going to have two pages, then I would add a MainPage field to your table. Page 1 would leave this field blank. Page 2 would have the value be the ID for page 1. So in your example, record ID 26 would have a MainPage field value of 25. If you think that you might end up with more pages, then add a PageNum field. To open page two then, you would run a query for records that have the MainPage value matching the current Page 1 record's ID.

    Comment

    • Dpot
      New Member
      • Oct 2014
      • 30

      #3
      Thank you for your response. I actually found exactly what I was looking for under the command button wizard in the design tab :).

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        I'm guessing that you found the Move Next button. Just know that it only takes you to the next record. It doesn't know any relationship to the first page. If the second page is always immediately after the first page, then you will be fine. If there is a gap, then you would need something to link the two pages together.

        Comment

        • Dpot
          New Member
          • Oct 2014
          • 30

          #5
          It was actually under the "open form" option. It gave me the option to set the fields I have/want linked. I have them stored in my table in a similar way you suggested to begin with. Works just how I need it to. Thank you! :)

          Comment

          Working...