473,586 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with totals on subforms

Ron
Hi All,

I've got a main form (frmMain) with 5 subforms on it. All subforms are
linked to different hidden controls on frmMain. The purpose of this form is
to record payments by 'source' (batches) so frmMain's source is a query on
BatchPaymentID. New 'source' for payment, new BatchPaymentID. 1st subform
(sfrmOne) is a client list of just the client's that would have that source
of payment. Next subform (sfrmTwo) is a list of charges (from the regular
transactions file) for the selected ClientID from sfrmOne. Select a charge
and it drops down to the payment subform...(sfrm Three) where the operator
can enter a payment and an adjustment should the payment not pay the charge
in full. Payments record into a table called tblPayAdjTransa ctions and then
will later (when all the payments entered equals the total for the check and
some other error trappings are done) post into the regular transactions file
(not there yet though).

So, all this works so far. No problems. Now we get to what doesn't work.

I have another subform, hidden, that I want to use as a "Total Payments"
kinda form (frmFour). It's linked to frmMain by the BatchPaymentID and
totals up all the payments, regardless of client from tblPayAdjTransa ctions
(on a query, of course). That way, I could have a running total of all
payments for the current batch, and display that on the main form. It
works, when the form initially loads (so, if all the payments equals $837.52
when I first open frmMain, I get that in the "Total of Payments" control on
the frmMain. And it works when one of the payments already recorded is
changed to a different amount. Change a $40 payment to $30 and the "Total
of Payments" control on frmMain changes to $827.52. But it DOES NOT update
when I add a new payment into tblPayAdjTransa ctions via sfrmThree, nor if I
change that just entered payment. Before the "Total Payments" control on
frmMain updates, I have to close frmMain and reopen it.

With this info, can someone suggest where I need to put whatever so that the
hidden form will update when records are added? I have another hidden form
that does the same thing, except it links by BatchPaymentID; ClientID and it
works the same way. Works fine when frmMain is loaded. Works fine if an
existing payment is changed. But DOES NOT update when a payment is added.

I've tried requerying the hidden forms, but nothing seems to work. I've
tried all the usual places, like Form_AfterUpdat e, Form_AfterInser t all in
the sfrmThree form, etc--all still not working. In trying to get this done,
I've tried:
Forms!frmMain!s frmFour!TotalOf Payments.Requer y

Suggestions? Is there an easier way to do running subtotals for different
purposes as I've indicated? Need more info to be able to help?

TIA
ron
Aug 29 '07 #1
2 1762
Ron wrote:
Hi All,

I've got a main form (frmMain) with 5 subforms on it. All subforms are
linked to different hidden controls on frmMain. The purpose of this form is
to record payments by 'source' (batches) so frmMain's source is a query on
BatchPaymentID. New 'source' for payment, new BatchPaymentID. 1st subform
(sfrmOne) is a client list of just the client's that would have that source
of payment. Next subform (sfrmTwo) is a list of charges (from the regular
transactions file) for the selected ClientID from sfrmOne. Select a charge
and it drops down to the payment subform...(sfrm Three) where the operator
can enter a payment and an adjustment should the payment not pay the charge
in full. Payments record into a table called tblPayAdjTransa ctions and then
will later (when all the payments entered equals the total for the check and
some other error trappings are done) post into the regular transactions file
(not there yet though).

So, all this works so far. No problems. Now we get to what doesn't work.

I have another subform, hidden, that I want to use as a "Total Payments"
kinda form (frmFour). It's linked to frmMain by the BatchPaymentID and
totals up all the payments, regardless of client from tblPayAdjTransa ctions
(on a query, of course). That way, I could have a running total of all
payments for the current batch, and display that on the main form. It
works, when the form initially loads (so, if all the payments equals $837.52
when I first open frmMain, I get that in the "Total of Payments" control on
the frmMain. And it works when one of the payments already recorded is
changed to a different amount. Change a $40 payment to $30 and the "Total
of Payments" control on frmMain changes to $827.52. But it DOES NOT update
when I add a new payment into tblPayAdjTransa ctions via sfrmThree, nor if I
change that just entered payment. Before the "Total Payments" control on
frmMain updates, I have to close frmMain and reopen it.

With this info, can someone suggest where I need to put whatever so that the
hidden form will update when records are added? I have another hidden form
that does the same thing, except it links by BatchPaymentID; ClientID and it
works the same way. Works fine when frmMain is loaded. Works fine if an
existing payment is changed. But DOES NOT update when a payment is added.

I've tried requerying the hidden forms, but nothing seems to work. I've
tried all the usual places, like Form_AfterUpdat e, Form_AfterInser t all in
the sfrmThree form, etc--all still not working. In trying to get this done,
I've tried:
Forms!frmMain!s frmFour!TotalOf Payments.Requer y

Suggestions? Is there an easier way to do running subtotals for different
purposes as I've indicated? Need more info to be able to help?

TIA
ron

In your form's afterUpdate event of subf3 maybe you need to requery
sfrmFour. I have no idea on how the value is being updated into the
Main form. Maybe
Forms!mainform! subform4.Requer y
Forms!Mainform! TotalPays = Forms!mainform! subform4!TotalP ays

Do you really need sf4? Probably not. You could have the control
source be something like (air code)
=NZ(Dsum("PayAm t","Transaction s","BatchID = " & [BatchID]),0)
or write a function to total the transactions called SumTXs and in the
control that displays to totals enter
=SumTxs()
so that when you add something in SF3, in the afterupdate event you enter
Forms!MainForm! TotalsField.Req uery
Aug 29 '07 #2
Ron

"Salad" <oi*@vinegar.co mwrote in message
news:13******** *****@corp.supe rnews.com...
Ron wrote:
>Hi All,

I've got a main form (frmMain) with 5 subforms on it. All subforms are
linked to different hidden controls on frmMain. The purpose of this form
is to record payments by 'source' (batches) so frmMain's source is a
query on BatchPaymentID. New 'source' for payment, new BatchPaymentID.
1st subform (sfrmOne) is a client list of just the client's that would
have that source of payment. Next subform (sfrmTwo) is a list of charges
(from the regular transactions file) for the selected ClientID from
sfrmOne. Select a charge and it drops down to the payment
subform...(sfr mThree) where the operator can enter a payment and an
adjustment should the payment not pay the charge in full. Payments
record into a table called tblPayAdjTransa ctions and then will later
(when all the payments entered equals the total for the check and some
other error trappings are done) post into the regular transactions file
(not there yet though).

So, all this works so far. No problems. Now we get to what doesn't
work.

I have another subform, hidden, that I want to use as a "Total Payments"
kinda form (frmFour). It's linked to frmMain by the BatchPaymentID and
totals up all the payments, regardless of client from
tblPayAdjTrans actions (on a query, of course). That way, I could have a
running total of all payments for the current batch, and display that on
the main form. It works, when the form initially loads (so, if all the
payments equals $837.52 when I first open frmMain, I get that in the
"Total of Payments" control on the frmMain. And it works when one of the
payments already recorded is changed to a different amount. Change a $40
payment to $30 and the "Total of Payments" control on frmMain changes to
$827.52. But it DOES NOT update when I add a new payment into
tblPayAdjTrans actions via sfrmThree, nor if I change that just entered
payment. Before the "Total Payments" control on frmMain updates, I have
to close frmMain and reopen it.

With this info, can someone suggest where I need to put whatever so that
the hidden form will update when records are added? I have another
hidden form that does the same thing, except it links by
BatchPaymentID ;ClientID and it works the same way. Works fine when
frmMain is loaded. Works fine if an existing payment is changed. But
DOES NOT update when a payment is added.

I've tried requerying the hidden forms, but nothing seems to work. I've
tried all the usual places, like Form_AfterUpdat e, Form_AfterInser t all
in the sfrmThree form, etc--all still not working. In trying to get this
done, I've tried:
Forms!frmMain! sfrmFour!TotalO fPayments.Reque ry

Suggestions? Is there an easier way to do running subtotals for
different purposes as I've indicated? Need more info to be able to help?

TIA
ron
In your form's afterUpdate event of subf3 maybe you need to requery
sfrmFour. I have no idea on how the value is being updated into the Main
form. Maybe
Forms!mainform! subform4.Requer y
Forms!Mainform! TotalPays = Forms!mainform! subform4!TotalP ays

Do you really need sf4? Probably not. You could have the control source
be something like (air code)
=NZ(Dsum("PayAm t","Transaction s","BatchID = " & [BatchID]),0)
or write a function to total the transactions called SumTXs and in the
control that displays to totals enter
=SumTxs()
so that when you add something in SF3, in the afterupdate event you enter
Forms!MainForm! TotalsField.Req uery

Hi Salad,

Thanks for the quick reply.

As you'll note from the original post, I did try the requery on sfrmFour but
slightly differently (with the control I'm looking for). Just tried your
way (without the control) and it works fine now...sheezzz.. . hours I've been
working on this! I'll put that same requery in a couple more places and
it'll do exactly what I want for what I've got so far. But I think I'll
play around with what else you've suggested to see if it'll work any
easier/faster/better.

Thanks again!
ron
Aug 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3396
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only happening when I put my XML files and the .xsl files on my ISP's system for my home page. If I try to open the XML files in Netscape 7.0 on my own machine...
1
2693
by: William Bradley | last post by:
At the moment I am having a problem with relationships and updating tables. The following is a production run. Table1 -- MainFormTable1 -- Basic Table Record Table2 ----SubFormTable2 -- Components of the Production Table3 ----SubFormTable3 -- QC Of the Production Table4 ----SubFormTable4 -- Customers to whom the production is sent. The...
3
3998
by: Evil | last post by:
Hi, i have a problem with a treeview and some subforms in MS Access97. I have a form with a treeview on the left side which lets me navigate thru some projects. Then on the right side, i have several Tabs, each with a subform. Now, my tree view nodclick code goes like: sProjNum = me.tvwX.SelectedItem.Key
7
6251
by: Ken Mylar | last post by:
First a quick background on the form: I have a form that is normally viewed in Single form mode. It has a subform on it that is in datasheet view. The main form is for work orders and the subform is for parts used on the work order. On the main form I have a LaborTotal (from main form), PartsTotal (from subform) and TotalCost (which is...
10
2835
by: rdemyan via AccessMonster.com | last post by:
I have a subform that displays around 10 fields. Most of the values shown result from some complex calculations. To make it easy, I have stored the results in a temporary table and then all I need to do is set the recordsource of the subform equal to the table. However, it would be very nice if the last row in the subform showed the...
9
9676
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
1
1247
by: Nasher | last post by:
This is so frustrating becuase i know this has a simple solution, but i just cant get it to work! Basically i have several subforms on a page (continuous forms) and they all have a simple sum function in a text box. sum=(). I now want to add all the totals and display them on the page in a text box. I've been trying to use the expression...
2
2079
by: warpcon | last post by:
I have a main form with a subform on it. The subforms columns are Qty , Part # , Description , Unit Price , and Ext Price. I put a text box on my main form named Total. I got the ext price to add up right from multiplying the qty by the unit price, but I cannot figure out how to total up the ext price column from all the rows and have it show in...
7
4608
by: IntelSldr | last post by:
Background: database is simple and controlled by one form with multiple tabs that include subforms under each tab. I have a totals row in a subform that counts the number of rows above it in order to tell me how many times something has happened to an employee (given an award, punished, etc.) I would like a way for that total to show in a...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.