473,671 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recalculate form sum

53 New Member
I have a subform footer the gives a total of the total price controls in a continuous form. The main form runs a query that changes what is displayed in the subform. The sum in the footer doesnt update until i click anywhere on the form.
I tried this in the afterupdate event on a command button in the main form the requerys the subform.

Me!Subform1.For m!ControlName.R ecalc

but i get error 2465

Thanks,

Lance
Jan 16 '08 #1
4 5270
Minion
108 Recognized Expert New Member
I take it that there is something that causes the form to run the query that changes in the information. Try adding Me.Requery after the code the launches this query.

Hope this helps.

- Minion -
Jan 16 '08 #2
araman
53 New Member
I take it that there is something that causes the form to run the query that changes in the information. Try adding Me.Requery after the code the launches this query.

Hope this helps.

- Minion -

This is what is in the afterupdate eventPrivate Sub EndDate_AfterUp date()
Me.Weekly_Ace_O rder.Form.Reque ry
Me!Weekly_Ace_O rder!Form!Text1 0.Recalc

End Sub

The first line requerys the subform but the total on the footer doesn't update until i click somewhere on the form. I added the second line and get the error.

text10 is the control in the footer that totals the subform
Any thoughts
Jan 16 '08 #3
Minion
108 Recognized Expert New Member
Two things here...

First: Error 2465 seems to stem from access being unable to find a specified record. This could be caused if you are trying to use recalc on an unbound control and it is looking for a control source. For now I would comment out (using ' ) the recalc line for now.

Second: If I am reading this right EndDate is a text box and is triggering the query to should update the form and the total. You might try moving the requery code to the Lost Focus event of the text box to ensure it triggers when the control looses focus. Additionally, if your still having trouble try changing the recalc to Me!Weekly_Ace_O rder!Form!Text1 0.Requery in the same event. This should do it.

My apologies for not being able to pin down an answer, but sub forms react differently sometimes and I don't use them often. So, give this a shot and I'll keep working on it on my end.

Hope this helps.

- Minion -

This is what is in the afterupdate eventPrivate Sub EndDate_AfterUp date()
Me.Weekly_Ace_O rder.Form.Reque ry
Me!Weekly_Ace_O rder!Form!Text1 0.Recalc

End Sub

The first line requerys the subform but the total on the footer doesn't update until i click somewhere on the form. I added the second line and get the error.

text10 is the control in the footer that totals the subform
Any thoughts
Jan 16 '08 #4
araman
53 New Member
Hello,

And thanks for the help.

Same thing occurs....but the on lost focus is a better idea. Thanks

I appreciate your help
Jan 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5645
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change to the appropriate mode and test the html form it gave me an 500 internel server error. I really need it to be done soon, I would not post here before I test it as much as I can,
5
6084
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
4
2119
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the same amount of Line Items. If I have all 20 Line Items, it works great. var sub1 = form.Line_Item_Subtotal1.value var sub2 = form.Line_Item_Subtotal2.value var sub3 = form.Line_Item_Subtotal3.value var sub4 = form.Line_Item_Subtotal4.value
25
10223
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
2
3567
by: Linda | last post by:
Hi, (Access 97) On my Menu form I have a button (cmdRefreshLinks) that refreshes/changes the linked tables in my database, and a calculated control (txtDataSource) that uses a custom function to display the location of the back-end database. (This is all done using Dev Ashish's 'Relink Tables' code from http://www.mvps.org/access/tables/tbl0009.htm.)
19
3603
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the thing you know ;-) After discovering that access 2000 support form properties (I'm a
11
18831
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
5
73205
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
2
1068
by: Jerry | last post by:
Hello, I am using this sub to show a form as a control (thanks George) on a main form. From a treeview the user can select which form should be shown and worked on. Private Sub ShowSubForm(ByVal sTabKey As String) Dim ctl As Control
0
8476
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8914
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8670
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7433
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5695
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4224
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2810
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.