Solved

Requery/Refresh subform

Posted on 2014-01-27
2
636 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39813862
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
ID: 39814015
perfect
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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