Welcome to SPN

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

Sign Up Now!

Totals in an unbound form

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

  1. Simon

    Simon
    Expand Collapse
    Guest

    I have an unbound form which currently has 8 invisible sub forms based on 8
    simple criteria queries. Each query uses the same date range paramter based
    on 2 text boxes on the main form.
    The user enters the date range on the main form and clicks a command button
    which requeries each of the invisible sub forms. Each of these in turn have
    a totals box in the footer of each form.
    I have 8 unbound text boxes whos data source is the total box on each form.
    These 8 unbound text boxes on the main form then display the total from each
    of the sub forms thereby providing a summary.
    Is it possible to remove the subforms and have the text boxes data source
    set to Sum the query directly once the command button is clicked.
    The reason for this is that the form is slow to load, I assume due to the
    amount of sub forms and these are firstly invisible and secondly need to be
    requeried with the date criteria anyway.
    I hope this makes sense and would be grateful of any help
    I am using Access 2003.
    Thanks.
     
  2. Simon

    Simon
    Expand Collapse
    Guest

    Its ok, I've sorted it out using DSum in the code of the command button.

    "Simon" wrote:

    > I have an unbound form which currently has 8 invisible sub forms based on 8
    > simple criteria queries. Each query uses the same date range paramter based
    > on 2 text boxes on the main form.
    > The user enters the date range on the main form and clicks a command button
    > which requeries each of the invisible sub forms. Each of these in turn have
    > a totals box in the footer of each form.
    > I have 8 unbound text boxes whos data source is the total box on each form.
    > These 8 unbound text boxes on the main form then display the total from each
    > of the sub forms thereby providing a summary.
    > Is it possible to remove the subforms and have the text boxes data source
    > set to Sum the query directly once the command button is clicked.
    > The reason for this is that the form is slow to load, I assume due to the
    > amount of sub forms and these are firstly invisible and secondly need to be
    > requeried with the date criteria anyway.
    > I hope this makes sense and would be grateful of any help
    > I am using Access 2003.
    > Thanks.
     
  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Use DSum on Each of the underlying queries
    ControlSource: = DSUM("TheField","TheSubQuery","DateField Between " &
    [txtDateFrom] " AND " & [txtDateTo])

    HTH

    Pieter

    "Simon" <Simon@discussions.microsoft.com> wrote in message
    news:1BF9FB15-D8B4-439A-8067-FD92FFFF2FB8@microsoft.com...
    >I have an unbound form which currently has 8 invisible sub forms based on 8
    > simple criteria queries. Each query uses the same date range paramter
    > based
    > on 2 text boxes on the main form.
    > The user enters the date range on the main form and clicks a command
    > button
    > which requeries each of the invisible sub forms. Each of these in turn
    > have
    > a totals box in the footer of each form.
    > I have 8 unbound text boxes whos data source is the total box on each
    > form.
    > These 8 unbound text boxes on the main form then display the total from
    > each
    > of the sub forms thereby providing a summary.
    > Is it possible to remove the subforms and have the text boxes data source
    > set to Sum the query directly once the command button is clicked.
    > The reason for this is that the form is slow to load, I assume due to the
    > amount of sub forms and these are firstly invisible and secondly need to
    > be
    > requeried with the date criteria anyway.
    > I hope this makes sense and would be grateful of any help
    > I am using Access 2003.
    > Thanks.




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4285 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     

Share This Page