Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking subform (2003)

    I have 2 forms and they are linked by a field clled req number. I fill out the first form and the req number field is automatically populated. I have it linked to the second form by req number but it opens up a fresh form. I want the second form to open up and automatically put the req number that was on the first form on the second form. I have seen some code before that works. I am a vb newbie so I am not quite sure to put the code also. Thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linking subform (2003)

    The easiest way to do this is to use the Forms wizard. If you select fields from two tables, it'll ask whether you want to use a main form and subform (which might be a good idea) or linked forms. If you choose the latter option, the Wizard will create the necessary code for you.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking subform (2003)

    if possible I would like the subform to be a stand alone form because of its size and just be able to link to it. Is there a way to do this?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linking subform (2003)

    As I wrote, the Forms wizard can create the forms for you, with the necessary code (at least, part of it). You can then modify the forms as needed.

  5. #5
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking subform (2003)

    We already have the 3 subforms built and they are all a tad different. Someone suggested the following but it doesn't work either. It doesn't like the first statement.

    Form.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linking subform (2003)

    You cannot open a form or refer to a form that way in Access. The syntax is

    DoCmd.OpenForm "sub"
    Forms!sub![your box] = Forms!main![master field]

    where sub and main are the names of the forms. If the names contain spaces, you must put square brackets [ ] around them.

Posting Permissions

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