Linking forms in access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinks
    New Member
    • Aug 2010
    • 3

    Linking forms in access

    Hello!

    I have created one form "A" from Table A with buttons that lead to other forms ("B", "C", "D") - with respective Table B, C and D.

    I'm trying to link the request ID of form A with the request ID of forms B, C and D. Request ID of Table A is linked to Request ID of Tables B, C and D.

    What I want to happen is that when a user enters their request ID into form A, form B, C and D will also reflect the same request ID so that the user is putting all their information on the same Request ID.

    Hope this makes sense.
  • munkee
    Contributor
    • Feb 2010
    • 374

    #2
    I think you are basically asking how would I pass some form of linking ID value across forms to each other?

    If so you can use the openargs statement in form open event.

    You use this in the docmd.openform command to send the ID and then in your next form in the load event you pick up the openarg ID and use it.

    Here is the ms example just to see if this is the kinda of thing you are after:



    It is also documented here in the final example:

    Comment

    • manxman777
      New Member
      • Jun 2010
      • 6

      #3
      you can also (if using VBA to determine the form's recordset) use this style

      forms!formA!Req uestID (assumes there is a textbox or similar on FormA that is called RequestID)

      Comment

      • twinks
        New Member
        • Aug 2010
        • 3

        #4
        Hi

        Thanks for the quick response. Yes it sounds like what you're describing is exactly what I want.

        Forgive my ignorance (I'm an Access noob here) and using any kind of coding is foreign to me - but how would I add this code into my forms?

        Comment

        • munkee
          Contributor
          • Feb 2010
          • 374

          #5
          Sure thing and no problem.

          There is actually a simpler way to do this which I neglected to remember.

          In your design view if you use the button wizard from the toolbox to add a button on to your form and select it to "open a form" along the way in the wizard there should be 2 options (provided you have a relationship defined between the two forms using a parent and child ID) which are:

          Open the form and find specific data to display

          or

          Open the form and show all the records.

          This basically uses a form filter to ensure the right data is displayed on the second form.

          It might be worth taking a look at this before delving in to too much coding.

          Comment

          • twinks
            New Member
            • Aug 2010
            • 3

            #6
            Hi munkee

            That seems to have done the trick! Thank you very much!

            Comment

            • munkee
              Contributor
              • Feb 2010
              • 374

              #7
              No problem twinks. I can put the sledge hammer down now since the nut was cracked with a much simpler method.

              Please select best answer on the post that provided the help the most so other users can easily find the information if they have a similar problem.

              By the way welcome to Bytes =]

              Comment

              Working...