Solved

Requery/Refresh subform

Posted on 2014-01-27
2
634 Views
Last Modified: 2014-01-27
I have a pretty standard from/subform form in an app I am developing.  The client uses it to set up payment plans for their customers.

The main form is frmInstallPain_Main with  recordsource of tblInstallPay_Main

The subform is frmInstallPay_Sub with a recordsource of qryInstallPay_sub, which is a query over tblInstallPay_Sub sorted so the due dates show in order.



On the main form there is a button 'Generate/Regenerate' payments.  When this button is pressed logic is invoked that looks at the items on the top of the screen (agreement date, number of payments, downpayment amount) then calculates the balance due for the account and generates a payment schedule for the specified number of payments.

Simple stuff and the logic work as it should.

If the user is editing an existing payment and clicks the button to regenerate, the new schedule is calculated and shows in the subform.

The problem is when a new plan is being entered.  All of the above steps take place but the payment schedule does not show in the subform.

To add a new plan the form is opened with acformadd :

docmd.openform "frmInstallPay_Main",,,,acformadd

How can I get the newly created payment plans to show the generated schedule in the subform?  

At this point the users have to exit the form and then come back in to see the generated schedule.  Obviously not acceptable.
0
Comment
Question by:mlcktmguy
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
you need to requery the subform.. after doing all the routine.


me.frmInstallPay_Sub.form.requery

or

me.Name_of_subform_control.form.requery


or use this


me.frmInstallPay_Sub.requery

or

me.Name_of_subform_control.requery


also you can try using the main form's current event to requery the subform

private sub form_current()

me.Name_of_subform_control.requery

end sub
0
 
LVL 1

Author Closing Comment

by:mlcktmguy
Comment Utility
perfect
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

771 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

14 Experts available now in Live!

Get 1:1 Help Now