Solved

Subform Won't Recalculate on New Record

Posted on 2010-08-26
12
410 Views
Last Modified: 2013-11-28
Hello,

I have a subform that when the parent form opens it does all the calculations in the subform for all the records that were there when it was closed. Although when I add a new record the subform produces the #Error in those fields trying to produce the calculations. What is the best way to refresh this subform to recalculate all the fields.
0
Comment
Question by:NuclearOil
  • 6
  • 4
  • 2
12 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility

try,
 after saving the record
    me.requery
or
   me.recalc
0
 
LVL 18

Expert Comment

by:Cluskitt
Comment Utility
Shouldn't it be: Me.SubformName.Requery?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
depends on where you will execute the code.
he was adding a new record in the subform, so after saving the record, or in the afterupdate event of the subform, you can just place
    me.requery
or
   me.recalc
0
 
LVL 18

Expert Comment

by:Cluskitt
Comment Utility
Ah yes, I had missed that part. You are, of course, correct. :)
0
 

Author Comment

by:NuclearOil
Comment Utility
Nope, neither of them seem to work, should it be in a before insert to requery the subform?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
can upload a copy of your db
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:NuclearOil
Comment Utility
Please look at the form Order Processing.The subform is linked to Stock Number in the main form. If you create a new record and use the stock number MB-08, you'll see the #Error. If you notice on when you load the form, the calculations happen.
-Error.mdb
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
please upload a working form..
the rowsource of the combo box at the main form is missing..

also include the instruction "how do you" create the new record using the subform
0
 

Author Comment

by:NuclearOil
Comment Utility
I added the row source for you. Its just a list of customers. I haven't made the form for the inventory yet, I have just been adding records to the table InventoryNPO to test the form they use to enter new orders and check stock.
-Error.mdb
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
how do you create "NEW record"?
0
 

Accepted Solution

by:
NuclearOil earned 0 total points
Comment Utility
I just hit the start button on the bottom of the main form for the time beining. If you add the stock number MB-08, you will get that #error.
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
how do you do that in the sample db that you uploaded?
there is no start button..

mind checking the sample db to reproduce the error before uploading
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now