Subform and MainForm Total

Discussion in 'Microsoft Access Forms' started by Guest, Mar 6, 2005.

  1. Guest

    Guest Guest

    Hi, there,

    I believe a lot of you may come across this problem. A form was set up for
    user to enter a couple of fields for calculation. User enters every field
    correctly in first time. Press button to calculate the total which was used
    to update something else - say a total field in Main form.

    Then, user goes back and does the editing. However, instead of entering
    everything, or TAB over to finish entering the whole information, user just
    quits in the middle. As a result, some information has been changed and the
    total as calculated is not consistent anymore.

    We allow user to edit the record, of course, please give your advise how to
    prevent those data inconsistency. Is there any code that force the user to
    TAB over every field in a form or record.

    Thank you.

    BL
     
    Guest, Mar 6, 2005
    #1
    1. Advertisements

  2. Guest

    Rick Brandt Guest

    BL wrote:
    > Hi, there,
    >
    > I believe a lot of you may come across this problem. A form was set
    > up for user to enter a couple of fields for calculation. User enters
    > every field correctly in first time. Press button to calculate the
    > total which was used to update something else - say a total field in
    > Main form.
    >
    > Then, user goes back and does the editing. However, instead of
    > entering everything, or TAB over to finish entering the whole
    > information, user just quits in the middle. As a result, some
    > information has been changed and the total as calculated is not
    > consistent anymore.
    >
    > We allow user to edit the record, of course, please give your advise
    > how to prevent those data inconsistency. Is there any code that
    > force the user to TAB over every field in a form or record.
    >
    > Thank you.
    >
    > BL


    It is a fundamental rule that you do not store the result of calculations.
    Store the DATA and when you need the result of the calculation let your computer
    compute it (that's what they're good at).


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com
     
    Rick Brandt, Mar 6, 2005
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    I have a way of doing this. In my case the user enters a total on the main
    form they then have to allocate in a continuous sub-form. The main form has a
    bound field called TotalAmnt. In the detail section of the sub form the user
    enters the line amounts. In the formfooter I keep a running total of these
    amounts with a field called lineTotal whose ControlSource is =sum(lineamnt).
    Finally in the main form I have a field which keeps track of the amount left
    to allocate whose control source is
    =[TotalAmnt]-nz([Forms]![Add Expenses Record]![ExpenseLinSub]!LineTotal,0).
    I don't let the user leave the form until the amount left to allocate field
    is zero.

    If this isn't what you want then you could try using the Ondirty event to
    ensure all calculations had been done before the user can leave the form. As
    in your case keeping running totals in this way isn't logically necessary -
    but it was a requirement so I had to make it happen. Good Luck!

    "BL" wrote:

    > Hi, there,
    >
    > I believe a lot of you may come across this problem. A form was set up for
    > user to enter a couple of fields for calculation. User enters every field
    > correctly in first time. Press button to calculate the total which was used
    > to update something else - say a total field in Main form.
    >
    > Then, user goes back and does the editing. However, instead of entering
    > everything, or TAB over to finish entering the whole information, user just
    > quits in the middle. As a result, some information has been changed and the
    > total as calculated is not consistent anymore.
    >
    > We allow user to edit the record, of course, please give your advise how to
    > prevent those data inconsistency. Is there any code that force the user to
    > TAB over every field in a form or record.
    >
    > Thank you.
    >
    > BL
     
    Guest, Mar 8, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. an

    MainForm, SubForm and SubSubForm

    an, Dec 28, 2004, in forum: Microsoft Access Forms
    Replies:
    7
    Views:
    218
  2. Pradeep

    sum of subform control and mainform

    Pradeep, Feb 10, 2005, in forum: Microsoft Access Forms
    Replies:
    1
    Views:
    181
    JohnFol
    Feb 10, 2005
  3. Nick Bradbury

    Mainform and Subform

    Nick Bradbury, Mar 26, 2006, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    175
    Nick Bradbury
    Mar 28, 2006
  4. Guest
    Replies:
    8
    Views:
    373
    Guest
    Apr 11, 2006
  5. yhengataccessmonster

    Duplicating MainForm, SubForm and Sub-SubForm

    yhengataccessmonster, Nov 28, 2007, in forum: Microsoft Access Forms
    Replies:
    0
    Views:
    188
    yhengataccessmonster
    Nov 28, 2007
Loading...

Share This Page