Solved

Requery/Refresh subform

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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

622 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