Refreshing data

Posted on 2003-02-24
Medium Priority
Last Modified: 2010-04-04
at the moment, I have a screen that then moves to one of two forms.  The problem I have is that when I view the form, go out and select another record and go back in, the displayed data is still the data from the previous record.

I need somehow to refresh the data without clearing the SQL or the query because that looses all the SQL which specifies the records to find.  
Question by:gleads
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
  • 3
  • 3
LVL 27

Expert Comment

ID: 8007719
try to establish a master-child relation
in delphi (properties mastersource,masterfield of the dataset).

otherwise you have to relocate the form2-data
in the afterscroll-event of the dataset on form1

meikl ;-)

Expert Comment

ID: 8026968
query1.requestlive := true;

Author Comment

ID: 8031930
requestlive what is this?
Industry Leaders: 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!


Expert Comment

ID: 8032698
No sorry.. I meant query1.AutoRefresh := true;
It's a property in the Object Inspector

From delphi help:
"When AutoRefresh is true, field values are automatically refreshed without an explicit call to the Refresh method."

I hope it helps

Gummi St.

Author Comment

ID: 8032717
I am using an ADO connection will this still work?

Accepted Solution

GummiStori earned 90 total points
ID: 8032877
No this is only in BDE

but your query is in another form, then you can let the form refresh the query when it's activated, by using the onActivate event for the form

procedure TForm2.FormActivate(Sender: TObject);

so when you select the form "focus on it or select it" it will refresh your query

Gummi St.

Author Comment

ID: 8032983
it says insufficient base table information

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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