Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Posts
    9

    Question Unanswered: Synchronize a main form with a linked form

    I am trying to synchronize two forms. A main form and a secondary form with related data. I don't want the secondary form to be a sub-form because not every record in the main form will have relevant data to be input in the secondary form; example,
    patient 1 suffers from condition A
    patient 2 suffers from condition A and B
    Patient 1 data is input into the main form but not the secondary form
    patient 2 data is input into main form and additional info into secondary form
    The forms are linked through a regular PK and FK relationship. PK from main form is FK for secondary form.
    I created a button that opens the secondary form from the main form but what happens is that the secondary form only synchronizes with records that are already present in the main form.
    How can I have the secondary form pick up the PK number from the main form, for patient 2. In other words if there is no secondary data as in the case for patient 1 no record is created because the secondary form is not opened; but if there is additional data the form is opened and that record gets stamped with the current PK ID # from the main form.
    I know nothing about programming so can this be done with macros or setting form attributes. Thanks very much for any help given.

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372

    Hello Bugs!

    Look at "DemoFormFormA2000.mdb" (attachment, zip).
    Look at Tables, Relationships, Forms (VBA), Module.
    In "Table2" (FormB) there are 3 records
    for f1ID=10 and f2= "AA" (Table1), and 2 records
    for f1ID=11 and f2= "AA" (Table1).

    Open FormA and try, I think it is what you want.
    Attached Files Attached Files

  3. #3
    Join Date
    Jul 2007
    Posts
    9
    Thanks MStef-ZG. I will try this solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •