Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a form and update

Status
Not open for further replies.

stickooo

Programmer
Jun 9, 2002
24
ID
Hi,

I have a Payment form that calculates all the payment received. Then, in the main form (Client form) I have a "total payment" box that calculates total payment for each client.

What I do now is go to Client form, and click on Payment tab on it to update a payment. However the total payment box is not updated automatically, unless I close and reopen the Client form

My question in how can I update the "total payment" box simultaneously when either I finish enter the new record of payment or close the payment form ?

thanks a lot.
 
Assuming that the calculation is done in the ControlSource of the GrandTotal control itself then in the frmPayment On_Close event place:-

Forms!frmClient!GrandTotal.Requery

OR

In the frmClient 's own On_Activate event put the same code.

HOWEVER, if the GrandTotal is obtained by running some code then you'll find it easier to put a call to that code in the frmClient's On_Activate event.



'ope-that-'elps.

G LS
 
It sounds like the MainForm(Client Form) is based upon(bound) a query/table that needs to be refreshed with the current data which includes the Total Payments. A simple

MainFormName.requery command will requery the main form and should give you updated values for your control object Total Payment. Put this command in the code where you update the payment or close the payment form.

See ACCESS Help for [Requery Method (Control or Form Object) for a more detail explaination on this command.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top