Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Access Form

Discussion in 'Information Technology' started by Annie, Jul 28, 2006.

Tags:
  1. Annie

    Annie
    Expand Collapse
    Guest

    Hi

    I am having a huge problem trying to get a total of 2 subforms in one main
    form.
    Example:

    My main form is created from a Table and has info on products and in this
    form I have brought in a subform as follows:

    Product Code Qty Price
    1 2 500
    2 3 600

    I have added a total field to the subform to allow the Qty x price :

    Product Code Qty Price Total
    1 2 500 1000
    2 3 600 1800

    I have a second subform with other product info set up the same way as above
    Subform 1 is for kitchen details - subform 2 is for wardrobe details.

    I would like to have the total of the totals for the first subform and then
    add this to the total of the totals for the 2nd subform. At the moment I
    have :

    Product Code Qty Price Total Grand Total
    1 2 500 1000 2800
    2 3 600 1800 2800

    I just added the Grand total on to both of the subforms =sum[Total]

    I noticed that the Grand Total gives me a total on every line - I can live
    with this but how can I add the 2 Grand Totals together in my main form??

    Please help before I completely lose it and give in!!!

    Many thanks and kind regards

    Kind regards

    Ann Shaw
     
  2. Loading...


  3. Mushroom

    Mushroom
    Expand Collapse
    Guest

    Hi Annie,
    I had this issue before and pulled out most of my hair!
    My solution was to place a calculated control in the subform's form footer
    section to get the subform total and then refer to that control from the main
    form. If that was too confusing, check the help files with Access. That is
    how I found the answer.

    In my situation, I didn't have 2 subforms so I had no need for a subtotal
    but you could place textboxes on the main form with a record source of the
    calculated subtotal for each form then make all the calculations with another
    textbox.


    --
    Kept in the dark and fed crap all the time.


    "Annie" wrote:

    > Hi
    >
    > I am having a huge problem trying to get a total of 2 subforms in one main
    > form.
    > Example:
    >
    > My main form is created from a Table and has info on products and in this
    > form I have brought in a subform as follows:
    >
    > Product Code Qty Price
    > 1 2 500
    > 2 3 600
    >
    > I have added a total field to the subform to allow the Qty x price :
    >
    > Product Code Qty Price Total
    > 1 2 500 1000
    > 2 3 600 1800
    >
    > I have a second subform with other product info set up the same way as above
    > Subform 1 is for kitchen details - subform 2 is for wardrobe details.
    >
    > I would like to have the total of the totals for the first subform and then
    > add this to the total of the totals for the 2nd subform. At the moment I
    > have :
    >
    > Product Code Qty Price Total Grand Total
    > 1 2 500 1000 2800
    > 2 3 600 1800 2800
    >
    > I just added the Grand total on to both of the subforms =sum[Total]
    >
    > I noticed that the Grand Total gives me a total on every line - I can live
    > with this but how can I add the 2 Grand Totals together in my main form??
    >
    > Please help before I completely lose it and give in!!!
    >
    > Many thanks and kind regards
    >
    > Kind regards
    >
    > Ann Shaw
     
  4. Annie

    Annie
    Expand Collapse
    Guest

    Thanks a million Mushroom! Never thought of putting the calculation in the
    Footer section. When you say refer to the subform calculated control in the
    main form what exactly do you mean can it be picked up relatively easy?

    Many thanks
    --
    Kind regards

    Ann Shaw


    "Mushroom" wrote:

    > Hi Annie,
    > I had this issue before and pulled out most of my hair!
    > My solution was to place a calculated control in the subform's form footer
    > section to get the subform total and then refer to that control from the main
    > form. If that was too confusing, check the help files with Access. That is
    > how I found the answer.
    >
    > In my situation, I didn't have 2 subforms so I had no need for a subtotal
    > but you could place textboxes on the main form with a record source of the
    > calculated subtotal for each form then make all the calculations with another
    > textbox.
    >
    >
    > --
    > Kept in the dark and fed crap all the time.
    >
    >
    > "Annie" wrote:
    >
    > > Hi
    > >
    > > I am having a huge problem trying to get a total of 2 subforms in one main
    > > form.
    > > Example:
    > >
    > > My main form is created from a Table and has info on products and in this
    > > form I have brought in a subform as follows:
    > >
    > > Product Code Qty Price
    > > 1 2 500
    > > 2 3 600
    > >
    > > I have added a total field to the subform to allow the Qty x price :
    > >
    > > Product Code Qty Price Total
    > > 1 2 500 1000
    > > 2 3 600 1800
    > >
    > > I have a second subform with other product info set up the same way as above
    > > Subform 1 is for kitchen details - subform 2 is for wardrobe details.
    > >
    > > I would like to have the total of the totals for the first subform and then
    > > add this to the total of the totals for the 2nd subform. At the moment I
    > > have :
    > >
    > > Product Code Qty Price Total Grand Total
    > > 1 2 500 1000 2800
    > > 2 3 600 1800 2800
    > >
    > > I just added the Grand total on to both of the subforms =sum[Total]
    > >
    > > I noticed that the Grand Total gives me a total on every line - I can live
    > > with this but how can I add the 2 Grand Totals together in my main form??
    > >
    > > Please help before I completely lose it and give in!!!
    > >
    > > Many thanks and kind regards
    > >
    > > Kind regards
    > >
    > > Ann Shaw
     
  5. Mushroom

    Mushroom
    Expand Collapse
    Guest

    Relatively easy is a relative term!

    Let me try this again.....
    Place a textbox in your main form and then select properties.
    Go to the data tab and beside the control souce box, click the build button.
    This will bring up the expression builder and you can point and click your
    way to the subform's subtotal control.

    I am far from an Access Pro so I hope I haven't left out anything critical.
    There are other ways to make this reference but they all depend on whether
    your form is bound to a table or a query.

    At any rate, the Access help files are much more elaborate than I am!
    --
    Kept in the dark and fed crap all the time.


    "Annie" wrote:

    > Thanks a million Mushroom! Never thought of putting the calculation in the
    > Footer section. When you say refer to the subform calculated control in the
    > main form what exactly do you mean can it be picked up relatively easy?
    >
    > Many thanks
    > --
    > Kind regards
    >
    > Ann Shaw
    >
    >
    > "Mushroom" wrote:
    >
    > > Hi Annie,
    > > I had this issue before and pulled out most of my hair!
    > > My solution was to place a calculated control in the subform's form footer
    > > section to get the subform total and then refer to that control from the main
    > > form. If that was too confusing, check the help files with Access. That is
    > > how I found the answer.
    > >
    > > In my situation, I didn't have 2 subforms so I had no need for a subtotal
    > > but you could place textboxes on the main form with a record source of the
    > > calculated subtotal for each form then make all the calculations with another
    > > textbox.
    > >
    > >
    > > --
    > > Kept in the dark and fed crap all the time.
    > >
    > >
    > > "Annie" wrote:
    > >
    > > > Hi
    > > >
    > > > I am having a huge problem trying to get a total of 2 subforms in one main
    > > > form.
    > > > Example:
    > > >
    > > > My main form is created from a Table and has info on products and in this
    > > > form I have brought in a subform as follows:
    > > >
    > > > Product Code Qty Price
    > > > 1 2 500
    > > > 2 3 600
    > > >
    > > > I have added a total field to the subform to allow the Qty x price :
    > > >
    > > > Product Code Qty Price Total
    > > > 1 2 500 1000
    > > > 2 3 600 1800
    > > >
    > > > I have a second subform with other product info set up the same way as above
    > > > Subform 1 is for kitchen details - subform 2 is for wardrobe details.
    > > >
    > > > I would like to have the total of the totals for the first subform and then
    > > > add this to the total of the totals for the 2nd subform. At the moment I
    > > > have :
    > > >
    > > > Product Code Qty Price Total Grand Total
    > > > 1 2 500 1000 2800
    > > > 2 3 600 1800 2800
    > > >
    > > > I just added the Grand total on to both of the subforms =sum[Total]
    > > >
    > > > I noticed that the Grand Total gives me a total on every line - I can live
    > > > with this but how can I add the 2 Grand Totals together in my main form??
    > > >
    > > > Please help before I completely lose it and give in!!!
    > > >
    > > > Many thanks and kind regards
    > > >
    > > > Kind regards
    > > >
    > > > Ann Shaw
     
  6. Annie

    Annie
    Expand Collapse
    Guest

    Thanks again for that - worked a treat!


    --
    Kind regards

    Ann Shaw


    "Mushroom" wrote:

    > Relatively easy is a relative term!
    >
    > Let me try this again.....
    > Place a textbox in your main form and then select properties.
    > Go to the data tab and beside the control souce box, click the build button.
    > This will bring up the expression builder and you can point and click your
    > way to the subform's subtotal control.
    >
    > I am far from an Access Pro so I hope I haven't left out anything critical.
    > There are other ways to make this reference but they all depend on whether
    > your form is bound to a table or a query.
    >
    > At any rate, the Access help files are much more elaborate than I am!
    > --
    > Kept in the dark and fed crap all the time.
    >
    >
    > "Annie" wrote:
    >
    > > Thanks a million Mushroom! Never thought of putting the calculation in the
    > > Footer section. When you say refer to the subform calculated control in the
    > > main form what exactly do you mean can it be picked up relatively easy?
    > >
    > > Many thanks
    > > --
    > > Kind regards
    > >
    > > Ann Shaw
    > >
    > >
    > > "Mushroom" wrote:
    > >
    > > > Hi Annie,
    > > > I had this issue before and pulled out most of my hair!
    > > > My solution was to place a calculated control in the subform's form footer
    > > > section to get the subform total and then refer to that control from the main
    > > > form. If that was too confusing, check the help files with Access. That is
    > > > how I found the answer.
    > > >
    > > > In my situation, I didn't have 2 subforms so I had no need for a subtotal
    > > > but you could place textboxes on the main form with a record source of the
    > > > calculated subtotal for each form then make all the calculations with another
    > > > textbox.
    > > >
    > > >
    > > > --
    > > > Kept in the dark and fed crap all the time.
    > > >
    > > >
    > > > "Annie" wrote:
    > > >
    > > > > Hi
    > > > >
    > > > > I am having a huge problem trying to get a total of 2 subforms in one main
    > > > > form.
    > > > > Example:
    > > > >
    > > > > My main form is created from a Table and has info on products and in this
    > > > > form I have brought in a subform as follows:
    > > > >
    > > > > Product Code Qty Price
    > > > > 1 2 500
    > > > > 2 3 600
    > > > >
    > > > > I have added a total field to the subform to allow the Qty x price :
    > > > >
    > > > > Product Code Qty Price Total
    > > > > 1 2 500 1000
    > > > > 2 3 600 1800
    > > > >
    > > > > I have a second subform with other product info set up the same way as above
    > > > > Subform 1 is for kitchen details - subform 2 is for wardrobe details.
    > > > >
    > > > > I would like to have the total of the totals for the first subform and then
    > > > > add this to the total of the totals for the 2nd subform. At the moment I
    > > > > have :
    > > > >
    > > > > Product Code Qty Price Total Grand Total
    > > > > 1 2 500 1000 2800
    > > > > 2 3 600 1800 2800
    > > > >
    > > > > I just added the Grand total on to both of the subforms =sum[Total]
    > > > >
    > > > > I noticed that the Grand Total gives me a total on every line - I can live
    > > > > with this but how can I add the 2 Grand Totals together in my main form??
    > > > >
    > > > > Please help before I completely lose it and give in!!!
    > > > >
    > > > > Many thanks and kind regards
    > > > >
    > > > > Kind regards
    > > > >
    > > > > Ann Shaw
     

Share This Page