Results 1 to 2 of 2

Thread: Populate subform that creates records based on main form

  1. #1
    Join Date
    Mar 2006
    Posts
    29

    Populate subform that creates records based on main form

    Hello,

    I have a main form where I enter the client number and then the matter number (the matter number is specific to the client number).

    I then want to have a button that will say "create notes" and it will open another form to create the notes (will create a record for the notes for that client and matter). How do I get the client number and matter number to populate the fields on the subform called "client number" and "matter number"?

    My notes table is the control source of the subform to create notes so if I change the client# field or the matter # field's control source using an expression to say "use the client number and matter number from the main form", then it won't populate the notes table.

    On a side note, there will be more than one button on the main form in which I will create a different kind of record (i.e., payment agreement, discount agreement, add a contact, etc.) for the client number and matter number listed in the main form so there will be more forms where I will need to use the same function to get the new record to add using the client number and matter number listed in the main form.

    Thanks for any advice!!

  2. #2
    Join Date
    May 2006
    Posts
    407
    When using a main form and a sub-form, what ever fields on the two forms that are used to "tie" the two forms together will automatically be added to the record created by the sub-form. Of course those fields must be in the table that is used with the sub-form.
    There is really no reason to have those fields show on the sub-form. They are already showing on the main form. To "tie" the main form with the sub-form, use the fields in the sub-form's property sheet named Link Fields Master and Link Child Fields to name the fields in the main form and sub-form that tie these records on the sub-form with the master record on the master form.

    Now, about the additional buttons on the main form that will allow the user to create different kinds of records. May I suggest that you use a tab control rather than buttons? The the user can click on that tab which will show the form (payment agreement, discount agreement, etc.) that corresponds to the tab.

Posting Permissions

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