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

Gathering SQL data efficeintly

Status
Not open for further replies.

KarenJB

IS-IT--Management
Dec 17, 2007
44
US
I have a remote view that will display all clients and an admission date in a grid. That part was easy using only two SQL tables and approx 8 fields. What I'd then like to happen is have the user double-click on a grid entry and the application access the rest of the data that is linked to that client - address, case manager, doctor, doctor's address, admission information etc. Some data is linked by the client id - address - demographics and some data is linked by an admission number - soc, diagnosis, etc - both in my original view. What is the best way to get that data from the SQL database at the time the user double clicks the grid - SPT or another/several remote view(s). I can't seem to figure out what to do next.
 
Hi Karen,

As far as efficiency is concerned, there's not a lot of difference between SPT and a remote view. Behind the scenes, they're basically the same thing.

Since you've started with remote views, you might as well continue with them.

You need to create a new view to hold the patient / admission data. Make it a parameterized view. Set the parameter equal to the field(s) within the client data that you are linking on. My guess is that the admission number will be unique withing the main view, in which case the admission number would be the parameter.

In your subsidiary form (the one the user sees after double-clicking), bind the controls to the fields in the new view.

In your application, open the new view with the NODATA clause. Then, at the point that the user double-clicks on the grid, set the parameter equal to the appropriate value in the main table (admission number of whatever) and call the REQUERY() function. That will populate the view with the data for the specified admission.

The last step is to refresh the form that displays the data from the new view.

Does that answer your question?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
That will give me something to try. It certainly seems to make sense. I'll give it a go and let you know how I did. Thanks Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top