Staying on the same record between a form and Subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amarantine
    New Member
    • Dec 2009
    • 2

    Staying on the same record between a form and Subform

    I have a from and a subform and I need to stay on the same record when I move from the main form to the subform. I have a "next" button with a macro on the last page of the form which navigates to the subform. However, I don't know how to follow the same record on the form and subform as new user adds a new record.

    My knowledge of codes and VBA and Microsoft Access is very limited. I tried to get around with macros so far this is the last part of the database that I don't know how to finish. I will appreciate any advise.

    Thanks
  • Megalog
    Recognized Expert Contributor
    • Sep 2007
    • 378

    #2
    Well first off, unless you're basing the form and subform on the same table, you will always be switching from one record to another when moving between the form/subform.

    If these are two separate tables being tied together, then you need to establish the parent/child relationship on the subform itself (look in the subform container properties). Then when you move from one record to the next on the main form, the subform relationship keeps both tables in sync.

    Comment

    • Amarantine
      New Member
      • Dec 2009
      • 2

      #3
      It is based on one table.

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        In that case the question that has to be asked is "What's the point?" Why do you have a main form/subform based on the same table?

        Welcome to Bytes!

        Linq ;0)>

        Comment

        • Megalog
          Recognized Expert Contributor
          • Sep 2007
          • 378

          #5
          I've never set up a subform to use the same table as the main form, any reason why you need it this way?

          The solution is the same for either scenario, set the parent & child fields on the subform control to the same field in the table (ideally an indexed field like your autonumber ID) and they should stay synchronized.

          Comment

          Working...