Results 1 to 3 of 3

Thread: Forms relations

  1. #1
    Join Date
    Mar 2004

    Arrow Unanswered: Forms relations

    MS Access can do this: Main Form underlying table ID (Companies.CompanyID, for example) will be inserted in Details Subform underlying table ID (Details.CompanyID, for example) every time new detail is added. This allow new detail records to be related to Main Form ID. Link is established thru Link child and Link master fields.

    How to achieve this in two separated Forms?

  2. #2
    Join Date
    Jun 2003
    In the DefaultValue property of the CompanyID field in the subform:

    J. Paul Schmidt, Freelance Web and Database Developer
    Access Database Sample, Web Database Sample, ASP Design Tips

  3. #3
    Join Date
    Feb 2004
    If you are using one form to open another form to create a record you have several options.

    The first is using the openargs parameter in the open form command and in the load event of the second form

    DoCmd.OpenForm "frmFormName", acNormal, , , acFormAdd, acDialog, SomeKey

    In opening form
    me!PrimaryKeyControlName = me.openargs

    Or you can open the form and use code to populate the keys.

    DoCmd.OpenForm "frmFormName", acNormal, , , acFormAdd, acDialog
    with forms!frmFormName
    !controlname = CurrentformName!ControlName

    Or if the second form may create more than one record you can use code in it to reference controls on the first form.

Posting Permissions

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