Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Mar 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forms & Subforms (Access '97)

    Ok, I have a form with a subform so I can add yearly info. to one company on the subform. It seems that when I add a subform to a company it's duplicating everything and instead of one form with 2 subforms it's 2 forms with 2 subforms exactly the same. I'm sure if I add another subform it would make 3 forms with 3 subforms. Is there anyway to fix this so I have 1 form with Company info. in it with multiple subforms with different years in it? Please let me know if I'm not making myself clear. I appreciate your help.... Thanks !!!!

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

    Re: Forms & Subforms (Access '97)

    I don't understand what you mean by "2 forms with two subforms". How can adding a subform duplicate the main form?

    BTW, is this a continuation of the thread you started with <post#=240361 >post 240361 </post#>? In <post#=240379>post 240379</post#> I suggested a way of handling information for different years for a single company. A single subform would suffice to display multiple years; a subform in "single form" view would display one year at a time (but with the possibility to move between years), while a subform in "continuous form" view would display several years at once.

    If you want to display data for 2003 in one subform, and data for 2002 in another subform, etc., consider using one continuous subform instead. If you still want different subforms, you must create a query that selects data for 2003, a query that selects data for 2002, etc., and use these queries as record source for the subforms. It will be a nuisance to maintain.

  3. #3
    New Lounger
    Join Date
    Mar 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms & Subforms (Access '97)

    Hans, I'm not sure how I'm supose to have one continuous subform. I actuallly thought that was what I was doing.
    This is what is happening: In one form It will allow me to add more then one subform but I am noticing now that it's taking that same form and duplicating it as many time as I entered information in the subforms for one form. Sorry, if that is confusing. Example.... 1 company with 5 yrs of info. I would enter in one form with 5 seperate subforms. It just duplicates all the information 5 times. I hope that explains what's happening.
    All I want is one form with how ever many years in the one form without duplicating the form. I have the form and subform linked one-to-many. did i miss something...... Is there something else that I need to do?

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

    Re: Forms & Subforms (Access '97)

    We may not be using the same terminology. Do you really mean that you added 5 subforms, or do you have one subform that shows 5 records?

    If you have five subforms showing identical information, it must be because you didn't link them to the main form correctly. If you just linked them by Company ID, they have no way to know that you want them to display different years. You'd need to create different queries to act as record source (which implies that you should create multiple copies of the subform) or link the subforms by Company ID and year. You could accomplish this by putting text boxes on the main form for the different years, and use these as second master link field.

  5. #5
    New Lounger
    Join Date
    Mar 2003
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms & Subforms (Access '97)

    Sorry I was using wrong terminology. It is one subform with 5 records for one form. Each record cause the form to be duplicated that many times. I am going to try what you said and see how it works out. Thanks.... If you have any other suggestions please let me know. I really appreciate your help. Thanks a lot.....

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

    Re: Forms & Subforms (Access '97)

    If you still have problems, try to provide more detailed information about the record source of the main form and of the subform., and about the master and chield linking fields.

    If the record source is a table, tell us something about the fields of the table (or post a screenshot); if it is a query, open it in design view, then switch to SQL view (View/SQL). Copy the SQL statement and paste it in a reply. Do this for both the main form and the subform.

Posting Permissions

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