• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

Subform Won't Recalculate on New Record

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
NuclearOil
Asked:
NuclearOil
  • 6
  • 4
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:

try,
 after saving the record
    me.requery
or
   me.recalc
0
 
CluskittCommented:
Shouldn't it be: Me.SubformName.Requery?
0
 
Rey Obrero (Capricorn1)Commented:
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
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
CluskittCommented:
Ah yes, I had missed that part. You are, of course, correct. :)
0
 
NuclearOilAuthor Commented:
Nope, neither of them seem to work, should it be in a before insert to requery the subform?
0
 
Rey Obrero (Capricorn1)Commented:
can upload a copy of your db
0
 
NuclearOilAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
NuclearOilAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
how do you create "NEW record"?
0
 
NuclearOilAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now