PC Review


Reply
Thread Tools Rate Thread

Subform and MainForm Total

 
 
=?Utf-8?B?Qkw=?=
Guest
Posts: n/a
 
      6th Mar 2005
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
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      6th Mar 2005
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9obiBQcml0Y2hhcmQ=?=
Guest
Posts: n/a
 
      8th Mar 2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
subform total to mainform John Microsoft Access Form Coding 2 13th Oct 2010 02:16 PM
Copying Mainform and Subform data onto new Mainform/Subform Hector Microsoft Access 3 25th Sep 2009 05:28 AM
subform combo to filter based on other subform...technically mainform's other subform records. nospam@thankyou.com Microsoft Access 0 15th Sep 2006 07:51 PM
Bring total from subform to mainform display in datasheet view =?Utf-8?B?RG9uIFJ1ZGQ=?= Microsoft Access Forms 8 11th Apr 2006 04:20 AM
Total from SubForm to MainForm goes to 0 =?Utf-8?B?S0xEb2xk?= Microsoft Access 1 1st May 2005 10:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 PM.