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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 7 refresh order on page object within a form

Status
Not open for further replies.

bettyfurr

Technical User
Joined
Mar 12, 2002
Messages
371
Location
US
I have a form with totals at the top.

A page object below this.

list boxes on the page with a select in the row source. As data is added, the totals change at the form level, a calculations occurs that adds the related data records, and then calculates on each data record (new and old) an percentage of the total amount on the top of form.

This all occurs correctly. If I exist the system, the refresh of the data occurs and it is correct. I have all the math in the refresh of the form object. But the timely is off.

I have so many refreshes in the objects of the add button, trust me
this.parent.parent.parent.parent.refresh
this.Parent.Parent.parent.Refresh
this.parent.list1.requery
this.parent.list1.refresh
this.parent.refresh
thisform.Refresh

The list box results, list box totals will refresh correctly on the page you are looking at, the next page totals are right but not the records in the list box.

This is a little wordy. Sorry about that.

Betty
 
try to refresh the form and focus it on the listbox
 
Hi Melchor,

Thank you for your response. The problem is that there are 3 list boxes per page and each list and each page needs updating.

betty

I am going to try putting the requery on the list box in the activate of the page and see if that works.
 
I would advise against using so many Refresh() calls. First of all, a "thisform.refresh()" will automatically call the Refresh() method of every control on the form. Sometimes a Refresh can actually be damaging.

Instead of having your calculations in the form Refresh() method, consider creating a custom form method for doing so. Then, when something changes, call the calculation method and refresh only the controls that might change, such as your totals. Of course, also requery() any list boxes whose contents will change.

Hope that helps,

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top