473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Recalculate form sum

53
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.Form!ControlName.Recalc

but i get error 2465

Thanks,

Lance
Jan 16 '08 #1
4 5250
Minion
108 Expert 100+
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
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_AfterUpdate()
Me.Weekly_Ace_Order.Form.Requery
Me!Weekly_Ace_Order!Form!Text10.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 Expert 100+
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_Order!Form!Text10.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_AfterUpdate()
Me.Weekly_Ace_Order.Form.Requery
Me!Weekly_Ace_Order!Form!Text10.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
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
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...
5
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...
4
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...
25
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...
2
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...
19
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...
11
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...
5
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
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.