Solved

Requery/Refresh subform

Posted on 2014-01-27
2
638 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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 …

763 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